2011-07-05 22:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
    * deleted empty lines and commented bad code
This commit is contained in:
Viktor Szakats
2011-07-05 20:53:49 +00:00
parent e7a9ca26be
commit 55839c05a7
2 changed files with 12 additions and 15 deletions

View File

@@ -16,9 +16,13 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-07-05 22:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
* deleted empty lines and commented bad code
2011-07-05 13:34 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp
! Fixed: a possible GPF trap where a GC item was being released
! Fixed: a possible GPF trap where a GC item was being released
in application code without owning it.
2011-07-05 22:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

View File

@@ -73,10 +73,10 @@ QVariant hbqt_fetchData( PHB_ITEM block, int type, int role, int par1, int par2
if( hb_vmRequestReenter() )
{
PHB_ITEM p0 = hb_itemPutNI( NULL, type );
PHB_ITEM p1 = hb_itemPutNI( NULL, role );
PHB_ITEM p2 = hb_itemPutNI( NULL, par1 );
PHB_ITEM p3 = hb_itemPutNI( NULL, par2 );
PHB_ITEM p0 = hb_itemPutNI( NULL, type );
PHB_ITEM p1 = hb_itemPutNI( NULL, role );
PHB_ITEM p2 = hb_itemPutNI( NULL, par1 );
PHB_ITEM p3 = hb_itemPutNI( NULL, par2 );
PHB_ITEM ret = hb_vmEvalBlockV( block, 4, p0, p1, p2, p3 );
@@ -127,14 +127,8 @@ QVariant hbqt_fetchData( PHB_ITEM block, int type, int role, int par1, int par2
vv = * ( ( QPixmap * ) ( p->ph ) );
else if( p->type == HBQT_TYPE_QFont )
vv = * ( ( QFont * ) ( p->ph ) );
}
}
#if 0 /* As discussed on the devel-list with Przemek */
if( ret )
{
hb_itemRelease( ret );
}
#endif
hb_vmRequestRestore();
}
@@ -143,7 +137,7 @@ QVariant hbqt_fetchData( PHB_ITEM block, int type, int role, int par1, int par2
HBQAbstractItemModel::HBQAbstractItemModel( PHB_ITEM pBlock ) : QAbstractItemModel()
{
if( pBlock)
if( pBlock )
{
block = hb_itemNew( pBlock );
hb_gcUnlock( block );
@@ -173,7 +167,7 @@ Qt::ItemFlags HBQAbstractItemModel::flags( const QModelIndex & index ) const
QVariant HBQAbstractItemModel::data( const QModelIndex & index, int role ) const
{
if( !index.isValid() )
if( ! index.isValid() )
return QVariant();
return hbqt_fetchData( block, HBQT_QAIM_data, role, index.column(), index.row() );
@@ -211,4 +205,3 @@ void HBQAbstractItemModel::reset()
}
#endif