diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 16b3982a08..f1e558c796 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,42 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-22 12:47 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/hbmk2_qt.hb + * contrib/hbqt/qtcore/hbqt.h + * contrib/hbqt/qtcore/hbqt_init.cpp + - Removed: a hack introduced some months back where + C++ static items were held in a list them released + at exit of an application. This was double work and + now is not needed at all. + + * contrib/hbqt/qtcore/hbqt_bind.cpp + - Reverted: last fix where was compared against + a numeric, which, BTW was a stupid implementation. + A pointer casted to a numeric is always true. + + * contrib/hbqt/qtgui/hbqt_init.cpp + - Deleted: deleting the QApplication object. + It was breaking such code: + oWnd:connect( QEvent_Close, {|| QApplication():quit() } ) + QApplication():exec() + the reason was any code executed after + QApplication():quit() was rendered unexcutable because + appln was forced to stop execution. + + * contrib/hbqt/qtcore/hbqt_hbqevents.cpp + + Reintroduced: QEvent_Close's return value to true. + It is necessary to intercept this event at appln level. + + * contrib/hbqt/qtcore/qth/QLibraryInfo.qth + * contrib/hbqt/qtgui/qth/QDesktopServices.qth + + Reworked: constructors. + Previous implementation was wrong. + Applied Francesco's thought and it worked, thanks. + + * contrib/hbqt/qtgui/qth/QSound.qth + + Added: two slot methods. + 2012-06-22 19:39 UTC+0200 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg * minor cleanup (var renamed) diff --git a/harbour/contrib/hbqt/hbmk2_qt.hb b/harbour/contrib/hbqt/hbmk2_qt.hb index 5056964a2b..cd7c700369 100644 --- a/harbour/contrib/hbqt/hbmk2_qt.hb +++ b/harbour/contrib/hbqt/hbmk2_qt.hb @@ -1499,7 +1499,6 @@ METHOD HbQtSource:build() AAdd( aLine, " if( s_oClass == NULL )" ) AAdd( aLine, " {" ) AAdd( aLine, " s_oClass = hb_itemNew( NULL );" ) - AAdd( aLine, " hbqt_addDeleteList( s_oClass );" ) FOR EACH k IN hb_aTokens( s, "," ) k := lower( AllTrim( k ) ) IF k == "hbqtobjecthandler" diff --git a/harbour/contrib/hbqt/qtcore/hbqt.h b/harbour/contrib/hbqt/qtcore/hbqt.h index 1c9bea8358..ffa44e7d48 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt.h +++ b/harbour/contrib/hbqt/qtcore/hbqt.h @@ -101,7 +101,6 @@ HB_EXPORT void * hbqt_get_ptr( PHB_ITEM pObj ); HB_EXPORT void hbqt_errRT_ARG( void ); HB_EXPORT PHB_ITEM hbqt_defineClassBegin( const char * pszClsName, PHB_ITEM s_oClass, const char * pszParentClsStr ); HB_EXPORT void hbqt_defineClassEnd( PHB_ITEM s_oClass, PHB_ITEM oClass ); -HB_EXPORT void hbqt_addDeleteList( PHB_ITEM item ); /* populate a list of PHB_ITEM to delete at exit time */ HB_EXPORT PHB_ITEM hbqt_bindGetHbObject( PHB_ITEM pItem, void * qtObject, const char * szClassFunc, PHBQT_DEL_FUNC pDelete, int iFlags ); HB_EXPORT PHB_ITEM hbqt_bindSetHbObject( PHB_ITEM pItem, void * qtObject, const char * szClassName, PHBQT_DEL_FUNC pDelFunc, int iFlags ); diff --git a/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp b/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp index 23bc88d999..5f43172b68 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_bind.cpp @@ -240,9 +240,8 @@ PHB_ITEM hbqt_bindGetHbObject( PHB_ITEM pItem, void * qtObject, const char * szC PHB_ITEM pObject = NULL; - if( ! HB_IS_NUMERIC( ( PHB_ITEM ) qtObject ) ) - if( qtObject == NULL ) - return pObject; + if( qtObject == NULL ) + return pObject; PHB_SYMB pClassFunc = hb_dynsymGetSymbol( szClassName ); if( pClassFunc == NULL ) diff --git a/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp b/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp index 15a721c58e..65ecfb5a38 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_hbqevents.cpp @@ -183,12 +183,10 @@ bool HBQEvents::eventFilter( QObject * object, QEvent * event ) hb_itemRelease( pArray ); } } - #if 0 if( eventtype == QEvent::Close ) { stopTheEventChain = true; } - #endif } } hb_vmRequestRestore(); diff --git a/harbour/contrib/hbqt/qtcore/hbqt_init.cpp b/harbour/contrib/hbqt/qtcore/hbqt_init.cpp index fcc6a97658..f308aa68ed 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_init.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_init.cpp @@ -494,26 +494,9 @@ static void hbqt_lib_init( void * cargo ) hbqt_registerCallbacks(); } -void hbqt_addDeleteList( PHB_ITEM item ) -{ - HB_TRACE( HB_TR_DEBUG, ( "-------------------------hbqt_addDeleteList # %d", s_PHB_ITEM_tobedeleted.size() ) ); - s_PHB_ITEM_tobedeleted << item; -} - static void hbqt_lib_exit( void * cargo ) { HB_SYMBOL_UNUSED( cargo ); - - while( ! s_PHB_ITEM_tobedeleted.isEmpty() ) - { - int i = s_PHB_ITEM_tobedeleted.size() - 1; - if( s_PHB_ITEM_tobedeleted.at( i ) != NULL ) - { - void * ptr = ( void * ) s_PHB_ITEM_tobedeleted.at( i ); - s_PHB_ITEM_tobedeleted.removeAt( i ); - hb_itemRelease( ptr ); - } - } } HB_CALL_ON_STARTUP_BEGIN( _hbqtcore_init_ ) diff --git a/harbour/contrib/hbqt/qtcore/qth/QLibraryInfo.qth b/harbour/contrib/hbqt/qtcore/qth/QLibraryInfo.qth index 07362dfa82..968e6f0d56 100644 --- a/harbour/contrib/hbqt/qtcore/qth/QLibraryInfo.qth +++ b/harbour/contrib/hbqt/qtcore/qth/QLibraryInfo.qth @@ -36,9 +36,7 @@ Constructor = */ HB_FUNC( QT_QLIBRARYINFO ) { - PHB_ITEM pItem = hb_itemPutNI( NULL, 0 ); - hb_itemReturnRelease( hbqt_bindGetHbObject( NULL, pItem, "HB_QLIBRARYINFO", NULL, HBQT_BIT_NONE ) ); - hb_itemRelease( pItem ); + HB_FUNC_EXEC( HB_QLIBRARYINFO ); } diff --git a/harbour/contrib/hbqt/qtgui/hbqt_init.cpp b/harbour/contrib/hbqt/qtgui/hbqt_init.cpp index 14b9a098d1..3450c54ba5 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_init.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_init.cpp @@ -831,8 +831,6 @@ static void hbqt_lib_exit( void * cargo ) { HB_SYMBOL_UNUSED( cargo ); fIsQuitting = HB_TRUE; - s_app->exit( 0 ); - delete s_app; } HB_FUNC( HBQT_ISACTIVEAPPLICATION ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QDesktopServices.qth b/harbour/contrib/hbqt/qtgui/qth/QDesktopServices.qth index e7f032d181..1d786c3327 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QDesktopServices.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QDesktopServices.qth @@ -35,9 +35,7 @@ Constructor = no */ HB_FUNC( QT_QDESKTOPSERVICES ) { - PHB_ITEM pItem = hb_itemPutNI( NULL, 0 ); - hb_itemReturnRelease( hbqt_bindGetHbObject( NULL, pItem, "HB_QDESKTOPSERVICES", NULL, HBQT_BIT_NONE ) ); - hb_itemRelease( pItem ); + HB_FUNC_EXEC( HB_QDESKTOPSERVICES ); } diff --git a/harbour/contrib/hbqt/qtgui/qth/QSound.qth b/harbour/contrib/hbqt/qtgui/qth/QSound.qth index f7f80e9af0..c1a80c8b76 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QSound.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QSound.qth @@ -61,6 +61,8 @@ void play ( const QString & filename ) +void play () +void stop ()