2010-10-28 23:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/qtcore/hbqt_misc.prg
+ Changed to not RTE when disconnecting not-connected
event. It will instead return .F. now.
To be consistent with slots in this regard.
* Undone previous optimization after realizing that
events and slots low-functiona return different error codes.
It didn't cause any harm with current system though.
* contrib/hbqt/qtcore/hbqt_hbqevents.cpp
% Optimized hb_snprintf() calls.
* contrib/hbqt/qtcore/hbqt_hbqevents.cpp
* contrib/hbqt/qtcore/hbqt_hbqslots.cpp
* Formatting.
* src/common/hbver.c
* Name of SPARC adjusted. Thanks to Tamas Tevesz.
This commit is contained in:
@@ -16,6 +16,25 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-10-28 23:51 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbqt/qtcore/hbqt_misc.prg
|
||||
+ Changed to not RTE when disconnecting not-connected
|
||||
event. It will instead return .F. now.
|
||||
To be consistent with slots in this regard.
|
||||
* Undone previous optimization after realizing that
|
||||
events and slots low-functiona return different error codes.
|
||||
It didn't cause any harm with current system though.
|
||||
|
||||
* contrib/hbqt/qtcore/hbqt_hbqevents.cpp
|
||||
% Optimized hb_snprintf() calls.
|
||||
|
||||
* contrib/hbqt/qtcore/hbqt_hbqevents.cpp
|
||||
* contrib/hbqt/qtcore/hbqt_hbqslots.cpp
|
||||
* Formatting.
|
||||
|
||||
* src/common/hbver.c
|
||||
* Name of SPARC adjusted. Thanks to Tamas Tevesz.
|
||||
|
||||
2010-10-28 19:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbqt/qtcore/hbqt_misc.prg
|
||||
* Laxed the rules for handling low-level connect/disconnect errors.
|
||||
|
||||
@@ -189,14 +189,14 @@ HB_FUNC( __HBQT_EVENTS_CONNECT )
|
||||
|
||||
if( t_events )
|
||||
{
|
||||
QObject * object = ( QObject* ) hbqt_pPtrFromObj( 2 ); /* get sender */
|
||||
QObject * object = ( QObject * ) hbqt_pPtrFromObj( 2 ); /* get sender */
|
||||
|
||||
if( object )
|
||||
{
|
||||
int type = hb_parni( 3 );
|
||||
|
||||
char prop[ 20 ];
|
||||
hb_snprintf( prop, sizeof( prop ), "%s%i%s", "P", type, "P" ); /* Make it a unique identifier */
|
||||
hb_snprintf( prop, sizeof( prop ), "P%iP", type ); /* Make it a unique identifier */
|
||||
|
||||
int i = object->property( prop ).toInt();
|
||||
if( i == 0 ) /* No Duplicates of same event with same object - it is a design decision - never alter */
|
||||
@@ -228,14 +228,14 @@ HB_FUNC( __HBQT_EVENTS_DISCONNECT )
|
||||
|
||||
if( t_events )
|
||||
{
|
||||
QObject * object = ( QObject* ) hbqt_pPtrFromObj( 2 );
|
||||
QObject * object = ( QObject * ) hbqt_pPtrFromObj( 2 );
|
||||
|
||||
if( object )
|
||||
{
|
||||
int type = hb_parni( 3 );
|
||||
|
||||
char prop[ 20 ];
|
||||
hb_snprintf( prop, sizeof( prop ), "%s%i%s", "P", type, "P" ); /* Make it a unique identifier */
|
||||
hb_snprintf( prop, sizeof( prop ), "P%iP", type ); /* Make it a unique identifier */
|
||||
|
||||
int i = object->property( prop ).toInt();
|
||||
if( i > 0 && i <= t_events->listBlock.size() )
|
||||
|
||||
@@ -201,7 +201,7 @@ HB_FUNC( __HBQT_SLOTS_CONNECT )
|
||||
|
||||
if( t_slots )
|
||||
{
|
||||
QObject * object = ( QObject * ) hbqt_pPtrFromObj( 2 ); /* get sender */
|
||||
QObject * object = ( QObject * ) hbqt_pPtrFromObj( 2 ); /* get sender */
|
||||
if( object )
|
||||
{
|
||||
PHB_ITEM pBlock = hb_itemNew( hb_param( 4, HB_IT_BLOCK ) ); /* get codeblock */
|
||||
|
||||
@@ -131,6 +131,13 @@ METHOD HbQtObjectHandler:connect( cnEvent, bBlock )
|
||||
::__pSlots := __hbqt_slots_new()
|
||||
ENDIF
|
||||
nResult := __hbqt_slots_connect( ::__pSlots, ::pPtr, cnEvent, bBlock )
|
||||
|
||||
SWITCH nResult
|
||||
CASE 0
|
||||
RETURN .T.
|
||||
CASE 8 /* QT connect call failure */
|
||||
RETURN .F.
|
||||
ENDSWITCH
|
||||
EXIT
|
||||
|
||||
CASE "N"
|
||||
@@ -140,19 +147,17 @@ METHOD HbQtObjectHandler:connect( cnEvent, bBlock )
|
||||
::installEventFilter( HBQEventsFromPointer( ::__pEvents ) )
|
||||
ENDIF
|
||||
nResult := __hbqt_events_connect( ::__pEvents, ::pPtr, cnEvent, bBlock )
|
||||
|
||||
SWITCH nResult
|
||||
CASE 0
|
||||
RETURN .T.
|
||||
ENDSWITCH
|
||||
EXIT
|
||||
|
||||
OTHERWISE
|
||||
nResult := 99
|
||||
ENDSWITCH
|
||||
|
||||
SWITCH nResult
|
||||
CASE 0
|
||||
RETURN .T.
|
||||
CASE 8 /* QT connect call failure */
|
||||
RETURN .F.
|
||||
ENDSWITCH
|
||||
|
||||
__hbqt_error( 1200 + nResult )
|
||||
|
||||
RETURN .F.
|
||||
@@ -164,25 +169,36 @@ METHOD HbQtObjectHandler:disconnect( cnEvent )
|
||||
|
||||
SWITCH ValType( cnEvent )
|
||||
CASE "C"
|
||||
|
||||
nResult := __hbqt_slots_disconnect( ::__pSlots, ::pPtr, cnEvent )
|
||||
|
||||
SWITCH nResult
|
||||
CASE 0
|
||||
CASE 4 /* signal not found in object */
|
||||
CASE 5 /* disconnect failure */
|
||||
RETURN .T.
|
||||
CASE 1 /* wrong slot container, no connect was called yet */
|
||||
CASE 3 /* event not found */
|
||||
RETURN .F.
|
||||
ENDSWITCH
|
||||
EXIT
|
||||
|
||||
CASE "N"
|
||||
|
||||
nResult := __hbqt_events_disconnect( ::__pEvents, ::pPtr, cnEvent )
|
||||
|
||||
SWITCH nResult
|
||||
CASE 0
|
||||
RETURN .T.
|
||||
CASE -3 /* event not found */
|
||||
RETURN .F.
|
||||
ENDSWITCH
|
||||
EXIT
|
||||
|
||||
OTHERWISE
|
||||
nResult := 99
|
||||
ENDSWITCH
|
||||
|
||||
SWITCH nResult
|
||||
CASE 0
|
||||
CASE 4 /* signal not found in object */
|
||||
CASE 5 /* disconnect failure */
|
||||
RETURN .T.
|
||||
CASE 1 /* wrong slot container, no connect was called yet */
|
||||
CASE 3 /* event not found */
|
||||
RETURN .F.
|
||||
ENDSWITCH
|
||||
|
||||
__hbqt_error( 1300 + nResult )
|
||||
|
||||
RETURN .F.
|
||||
|
||||
@@ -112,9 +112,9 @@ const char * hb_verCPU( void )
|
||||
#elif defined( HB_CPU_PPC_64 )
|
||||
return "PPC64";
|
||||
#elif defined( HB_CPU_SPARC )
|
||||
return "Sparc/32";
|
||||
return "SPARC";
|
||||
#elif defined( HB_CPU_SPARC_64 )
|
||||
return "Sparc/64";
|
||||
return "SPARC64";
|
||||
#elif defined( HB_CPU_ARM )
|
||||
return "ARM";
|
||||
#elif defined( HB_CPU_MIPS )
|
||||
|
||||
Reference in New Issue
Block a user