[wpdev-commits] wolfpack uobject.cpp,1.179,1.180 uobject.h,1.105,1.106
Brought to you by:
rip,
thiagocorrea
From: Jorge P. <ke...@us...> - 2004-08-25 00:41:37
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6628 Modified Files: uobject.cpp uobject.h Log Message: ... Index: uobject.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v retrieving revision 1.179 retrieving revision 1.180 diff -C2 -d -r1.179 -r1.180 *** uobject.cpp 24 Aug 2004 19:38:17 -0000 1.179 --- uobject.cpp 25 Aug 2004 00:41:25 -0000 1.180 *************** *** 331,335 **** Adds an event handler to this object */ ! void cUObject::addEvent( cPythonScript* event ) { if ( isScriptChainFrozen() ) --- 331,335 ---- Adds an event handler to this object */ ! void cUObject::addEvent( cPythonScript* event, bool append ) { if ( isScriptChainFrozen() ) *************** *** 349,355 **** cPythonScript** newScriptChain = new cPythonScript* [count + 2]; ! memcpy( newScriptChain, scriptChain, ( count + 1 ) * sizeof( cPythonScript * ) ); newScriptChain[0] = reinterpret_cast<cPythonScript*>( count + 1 ); - newScriptChain[count + 1] = event; delete[] scriptChain; --- 349,364 ---- cPythonScript** newScriptChain = new cPythonScript* [count + 2]; ! if ( append || count == 0 ) ! { ! memcpy( newScriptChain, scriptChain, ( count + 1 ) * sizeof( cPythonScript * ) ); ! newScriptChain[count + 1] = event; ! } ! else ! { ! // make room for the 1st event ! memcpy( &newScriptChain[2], &scriptChain[1], ( count ) * sizeof( cPythonScript * ) ); ! newScriptChain[1] = event; ! } newScriptChain[0] = reinterpret_cast<cPythonScript*>( count + 1 ); delete[] scriptChain; *************** *** 383,387 **** } ! if ( !hasEvent( event->name() ) ) { return; --- 392,396 ---- } ! if ( !hasEvent( name ) ) { return; Index: uobject.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** uobject.h 19 Aug 2004 01:55:56 -0000 1.105 --- uobject.h 25 Aug 2004 00:41:25 -0000 1.106 *************** *** 109,113 **** // Event Management Methods void clearEvents(); ! void addEvent( cPythonScript* Event ); void removeEvent( const QString& Name ); bool hasEvent( const QString& Name ) const; --- 109,113 ---- // Event Management Methods void clearEvents(); ! void addEvent( cPythonScript * Event, bool append = false ); void removeEvent( const QString& Name ); bool hasEvent( const QString& Name ) const; |