From 55839c05a72c8634baf89741f0d6ce3dd8caf792 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 5 Jul 2011 20:53:49 +0000 Subject: [PATCH] 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 --- harbour/ChangeLog | 6 +++++- .../hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp | 21 +++++++------------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7e55458957..bdd3d1d372 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -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) diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp index e92681e785..ea6a1664a2 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqabstractitemmodel.cpp @@ -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 -