diff options
Diffstat (limited to 'src/kernel/qobject.cpp')
-rw-r--r-- | src/kernel/qobject.cpp | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/src/kernel/qobject.cpp b/src/kernel/qobject.cpp index 665aead21..7156df6be 100644 --- a/src/kernel/qobject.cpp +++ b/src/kernel/qobject.cpp @@ -52,7 +52,7 @@ // TQStyleControlElementData #include "ntqstyle.h" -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT #include "ntqmutex.h" #include <private/qmutexpool_p.h> #include "ntqthread.h" @@ -130,16 +130,16 @@ TQStyleControlElementDataPrivate* TQObject::controlElementDataPrivateObject() { return d->controlElementDataPrivate; } -#if defined(QT_THREAD_SUPPORT) +#if defined(TQT_THREAD_SUPPORT) void TQObject::moveToThread_helper(TQThread *targetThread) { TQEvent e(TQEvent::ThreadChange); TQApplication::sendEvent(this, &e); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT TQMutexLocker locker( d->childObjectListMutex ); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if (childObjects) { TQObject *child; @@ -155,9 +155,9 @@ void TQObject::setThreadObject_helper(TQThread *targetThread) { d->ownThread = targetThread; -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT TQMutexLocker locker( d->childObjectListMutex ); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if (childObjects) { TQObject *child; @@ -185,9 +185,9 @@ void TQObject::setThreadObject_helper(TQThread *targetThread) */ void TQObject::moveToThread(TQThread *targetThread) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT TQMutexLocker locker( TQApplication::tqt_mutex ); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if (parentObj) { #if defined(QT_DEBUG) @@ -491,7 +491,7 @@ void *tqt_find_obj_child( TQObject *parent, const char *type, const char *name ) return 0; } -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT /*! Returns a pointer to the TQThread* associated with @@ -530,12 +530,12 @@ static void qt_spy_signal( TQObject* sender, int signal, TQUObject* o ) s.sprintf( "%s_%s", mo->className(), sigData->name ); int slot = tqt_preliminary_signal_spy->metaObject()->findSlot( s, TRUE ); if ( slot >= 0 ) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT // protect access to qt_spy_signal_sender void * const address = &qt_spy_signal_sender; TQMutexLocker locker( tqt_global_mutexpool ? tqt_global_mutexpool->get( address ) : 0 ); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT TQObject* old_sender = qt_spy_signal_sender; qt_spy_signal_sender = sender; @@ -554,7 +554,7 @@ static void qt_spy_signal( TQObject* sender, int signal, TQUObject* o ) static TQObjectList* object_trees = 0; -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT static TQMutex *obj_trees_mutex = 0; #endif @@ -562,7 +562,7 @@ static void cleanup_object_trees() { delete object_trees; object_trees = 0; -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT delete obj_trees_mutex; obj_trees_mutex = 0; #endif @@ -576,7 +576,7 @@ static void ensure_object_trees() static void insert_tree( TQObject* obj ) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if ( !obj_trees_mutex ) obj_trees_mutex = new TQMutex(); TQMutexLocker locker( obj_trees_mutex ); @@ -589,7 +589,7 @@ static void insert_tree( TQObject* obj ) static void remove_tree( TQObject* obj ) { if ( object_trees ) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT TQMutexLocker locker( obj_trees_mutex ); #endif object_trees->removeRef( obj ); @@ -780,10 +780,10 @@ TQObject::~TQObject() delete childObjects; } -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT delete d->childObjectListMutex; delete d->senderObjectListMutex; -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT delete d; } @@ -1079,17 +1079,17 @@ bool TQObject::event( TQEvent *e ) TQSenderObjectList* sol; TQObject* oldSender = 0; sol = senderObjects; -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if ( sol ) { oldSender = sol->currentSender; sol->ref(); sol->currentSender = metaEvent->sender(); } -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT TQUObject *o = metaEvent->data(); if (metaEvent->type() == TQMetaCallEvent::MetaCallEmit) { tqt_emit( metaEvent->id(), o ); @@ -1097,9 +1097,9 @@ bool TQObject::event( TQEvent *e ) if (metaEvent->type() == TQMetaCallEvent::MetaCallInvoke) { tqt_invoke( metaEvent->id(), o ); } -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if (sol ) { sol->currentSender = oldSender; if ( sol->deref() ) { @@ -1108,9 +1108,9 @@ bool TQObject::event( TQEvent *e ) sol = NULL; } } -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (sol) sol->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } else { tqWarning("TQObject: Ignoring metacall event from non-owning thread"); @@ -1617,9 +1617,9 @@ TQConnectionList *TQObject::receivers( int signal ) const void TQObject::insertChild( TQObject *obj ) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT TQMutexLocker locker( d->childObjectListMutex ); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if ( obj->isTree ) { remove_tree( obj ); @@ -1663,9 +1663,9 @@ void TQObject::insertChild( TQObject *obj ) void TQObject::removeChild( TQObject *obj ) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT TQMutexLocker locker( d->childObjectListMutex ); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if ( childObjects && childObjects->removeRef(obj) ) { obj->parentObj = 0; @@ -1903,12 +1903,12 @@ const TQObject *TQObject::sender() { #ifndef QT_NO_PRELIMINARY_SIGNAL_SPY if ( this == tqt_preliminary_signal_spy ) { -# ifdef QT_THREAD_SUPPORT +# ifdef TQT_THREAD_SUPPORT // protect access to qt_spy_signal_sender void * const address = &qt_spy_signal_sender; TQMutexLocker locker( tqt_global_mutexpool ? tqt_global_mutexpool->get( address ) : 0 ); -# endif // QT_THREAD_SUPPORT +# endif // TQT_THREAD_SUPPORT return qt_spy_signal_sender; } #endif @@ -2252,24 +2252,24 @@ void TQObject::connectInternal( const TQObject *sender, int signal_index, const TQ_CHECK_PTR( c ); clist->append( c ); if ( !r->senderObjects ) { // create list of senders -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT r->d->senderObjectListMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT r->senderObjects = new TQSenderObjectList; -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT r->senderObjects->listMutex->lock(); r->d->senderObjectListMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } else { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT r->senderObjects->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } r->senderObjects->append( s ); // add sender to list -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT r->senderObjects->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } @@ -2475,25 +2475,25 @@ bool TQObject::disconnectInternal( const TQObject *sender, int signal_index, c = clist->first(); while ( c ) { // for all receivers... if ( r == 0 ) { // remove all receivers -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT removeObjFromList( c->object()->senderObjects, s ); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT success = TRUE; c = clist->next(); } else if ( r == c->object() && ( (member_index == -1) || ((member_index == c->member()) && (c->memberType() == membcode)) ) ) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT removeObjFromList( c->object()->senderObjects, s, TRUE ); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT success = TRUE; clist->remove(); c = clist->current(); @@ -2512,25 +2512,25 @@ bool TQObject::disconnectInternal( const TQObject *sender, int signal_index, c = clist->first(); while ( c ) { // for all receivers... if ( r == 0 ) { // remove all receivers -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT removeObjFromList( c->object()->senderObjects, s, TRUE ); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT success = TRUE; c = clist->next(); } else if ( r == c->object() && ( (member_index == -1) || ((member_index == c->member()) && (c->memberType() == membcode)) ) ) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT removeObjFromList( c->object()->senderObjects, s, TRUE ); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT success = TRUE; clist->remove(); c = clist->current(); @@ -2772,9 +2772,9 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) c = clist->first(); object = c->object(); sol = object->senderObjects; -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if ( sol ) { oldSender = sol->currentSender; sol->ref(); @@ -2785,13 +2785,13 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) (object->d->disableThreadPostedEvents) || (currentThread && currentThread->threadPostedEventsDisabled()) || (currentThread && object->d->ownThread == currentThread)) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT object->tqt_emit( c->member(), o ); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } else { if (object->d->ownThread && !object->d->ownThread->finished()) { @@ -2807,13 +2807,13 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) (object->d->disableThreadPostedEvents) || (currentThread && currentThread->threadPostedEventsDisabled()) || (currentThread && object->d->ownThread == currentThread)) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT object->tqt_invoke( c->member(), o ); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } else { if (object->d->ownThread && !object->d->ownThread->finished()) { @@ -2832,9 +2832,9 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) sol = NULL; } } -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (sol) sol->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } else { TQConnection *cd = 0; TQConnectionListIt it(*clist); @@ -2845,9 +2845,9 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) cd = c; object = c->object(); sol = object->senderObjects; -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT if ( sol ) { oldSender = sol->currentSender; sol->ref(); @@ -2858,13 +2858,13 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) (object->d->disableThreadPostedEvents) || (currentThread && currentThread->threadPostedEventsDisabled()) || (currentThread && object->d->ownThread == currentThread)) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT object->tqt_emit( c->member(), o ); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } else { if (object->d->ownThread && !object->d->ownThread->finished()) { @@ -2880,13 +2880,13 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) (object->d->disableThreadPostedEvents) || (currentThread && currentThread->threadPostedEventsDisabled()) || (currentThread && object->d->ownThread == currentThread)) { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT object->tqt_invoke( c->member(), o ); -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT sol->listMutex->lock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } else { if (object->d->ownThread && !object->d->ownThread->finished()) { @@ -2905,9 +2905,9 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) sol = NULL; } } -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT if (sol) sol->listMutex->unlock(); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT } } } @@ -3046,9 +3046,9 @@ void TQObject::dumpObjectTree() void TQObject::dumpObjectInfo() { -#ifdef QT_THREAD_SUPPORT +#ifdef TQT_THREAD_SUPPORT TQMutexLocker locker( d->senderObjectListMutex ); -#endif // QT_THREAD_SUPPORT +#endif // TQT_THREAD_SUPPORT #if defined(QT_DEBUG) tqDebug( "OBJECT %s::%s", className(), name( "unnamed" ) ); |