|
|
@ -73,6 +73,8 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
TQThread* ownThread;
|
|
|
|
TQThread* ownThread;
|
|
|
|
|
|
|
|
TQMutex* senderObjectListMutex;
|
|
|
|
|
|
|
|
TQMutex* childObjectListMutex;
|
|
|
|
bool disableThreadPostedEvents;
|
|
|
|
bool disableThreadPostedEvents;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -83,6 +85,10 @@ void TQObject::moveToThread_helper(TQThread *targetThread)
|
|
|
|
TQEvent e(TQEvent::ThreadChange);
|
|
|
|
TQEvent e(TQEvent::ThreadChange);
|
|
|
|
TQApplication::sendEvent(this, &e);
|
|
|
|
TQApplication::sendEvent(this, &e);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
TQMutexLocker locker( d->childObjectListMutex );
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
if (childObjects) {
|
|
|
|
if (childObjects) {
|
|
|
|
TQObject *child;
|
|
|
|
TQObject *child;
|
|
|
|
TQObjectListIt it(*childObjects);
|
|
|
|
TQObjectListIt it(*childObjects);
|
|
|
@ -97,12 +103,16 @@ void TQObject::setThreadObject_helper(TQThread *targetThread)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->ownThread = targetThread;
|
|
|
|
d->ownThread = targetThread;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
TQMutexLocker locker( d->childObjectListMutex );
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
if (childObjects) {
|
|
|
|
if (childObjects) {
|
|
|
|
TQObject *child;
|
|
|
|
TQObject *child;
|
|
|
|
TQObjectListIt it(*childObjects);
|
|
|
|
TQObjectListIt it(*childObjects);
|
|
|
|
while ( (child=it.current()) ) {
|
|
|
|
while ( (child=it.current()) ) {
|
|
|
|
++it;
|
|
|
|
++it;
|
|
|
|
child->moveToThread_helper(targetThread);
|
|
|
|
child->setThreadObject_helper(targetThread);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -123,7 +133,9 @@ void TQObject::setThreadObject_helper(TQThread *targetThread)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void TQObject::moveToThread(TQThread *targetThread)
|
|
|
|
void TQObject::moveToThread(TQThread *targetThread)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
TQMutexLocker locker( TQApplication::tqt_mutex );
|
|
|
|
TQMutexLocker locker( TQApplication::tqt_mutex );
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
if (parentObj) {
|
|
|
|
if (parentObj) {
|
|
|
|
#if defined(QT_DEBUG)
|
|
|
|
#if defined(QT_DEBUG)
|
|
|
@ -179,11 +191,23 @@ void TQObject::disableThreadPostedEvents(bool disable) {
|
|
|
|
|
|
|
|
|
|
|
|
class TQSenderObjectList : public TQObjectList, public TQShared
|
|
|
|
class TQSenderObjectList : public TQObjectList, public TQShared
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
TQSenderObjectList() : currentSender( 0 ) { }
|
|
|
|
TQSenderObjectList();
|
|
|
|
TQObject *currentSender;
|
|
|
|
~TQSenderObjectList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
TQObject *currentSender;
|
|
|
|
|
|
|
|
TQMutex *listMutex;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQSenderObjectList::TQSenderObjectList() : currentSender( 0 ) {
|
|
|
|
|
|
|
|
listMutex = new TQMutex( TRUE );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQSenderObjectList::~TQSenderObjectList() {
|
|
|
|
|
|
|
|
delete listMutex;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class Q_EXPORT TQMetaCallEvent : public TQEvent
|
|
|
|
class Q_EXPORT TQMetaCallEvent : public TQEvent
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
@ -369,8 +393,9 @@ bool qKillTimer( TQObject *obj );
|
|
|
|
static void removeObjFromList( TQObjectList *objList, const TQObject *obj,
|
|
|
|
static void removeObjFromList( TQObjectList *objList, const TQObject *obj,
|
|
|
|
bool single=FALSE )
|
|
|
|
bool single=FALSE )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !objList )
|
|
|
|
if ( !objList ) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
int index = objList->findRef( obj );
|
|
|
|
int index = objList->findRef( obj );
|
|
|
|
while ( index >= 0 ) {
|
|
|
|
while ( index >= 0 ) {
|
|
|
|
objList->remove();
|
|
|
|
objList->remove();
|
|
|
@ -585,20 +610,25 @@ TQObject::TQObject( TQObject *parent, const char *name )
|
|
|
|
postedEvents( 0 ), // no events posted
|
|
|
|
postedEvents( 0 ), // no events posted
|
|
|
|
d( 0 )
|
|
|
|
d( 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !metaObj ) // will create object dict
|
|
|
|
if ( !d ) {
|
|
|
|
|
|
|
|
d = new TQObjectPrivate(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d->ownThread = TQThread::currentThreadObject();
|
|
|
|
|
|
|
|
d->senderObjectListMutex = new TQMutex( TRUE );
|
|
|
|
|
|
|
|
d->childObjectListMutex = new TQMutex( TRUE );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !metaObj ) { // will create object dict
|
|
|
|
(void) staticMetaObject();
|
|
|
|
(void) staticMetaObject();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( parent ) { // add object to parent
|
|
|
|
if ( parent ) { // add object to parent
|
|
|
|
parent->insertChild( this );
|
|
|
|
parent->insertChild( this );
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
insert_tree( this );
|
|
|
|
insert_tree( this );
|
|
|
|
isTree = TRUE;
|
|
|
|
isTree = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( !d )
|
|
|
|
|
|
|
|
d = new TQObjectPrivate(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d->ownThread = TQThread::currentThreadObject();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -630,10 +660,15 @@ TQObject::~TQObject()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tqApp) {
|
|
|
|
|
|
|
|
TQEvent destroyEvent(TQEvent::Destroy);
|
|
|
|
|
|
|
|
tqApp->notify(this, &destroyEvent);
|
|
|
|
|
|
|
|
}
|
|
|
|
wasDeleted = 1;
|
|
|
|
wasDeleted = 1;
|
|
|
|
blockSig = 0; // unblock signals to keep TQGuardedPtr happy
|
|
|
|
blockSig = 0; // unblock signals to keep TQGuardedPtr happy
|
|
|
|
emit destroyed( this );
|
|
|
|
emit destroyed( this );
|
|
|
|
emit destroyed();
|
|
|
|
emit destroyed();
|
|
|
|
|
|
|
|
|
|
|
|
if ( objname ) {
|
|
|
|
if ( objname ) {
|
|
|
|
delete [] (char*)objname;
|
|
|
|
delete [] (char*)objname;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -669,8 +704,9 @@ TQObject::~TQObject()
|
|
|
|
TQConnectionListIt cit(*clist);
|
|
|
|
TQConnectionListIt cit(*clist);
|
|
|
|
while( (c=cit.current()) ) { // for each connected slot...
|
|
|
|
while( (c=cit.current()) ) { // for each connected slot...
|
|
|
|
++cit;
|
|
|
|
++cit;
|
|
|
|
if ( (obj=c->object()) )
|
|
|
|
if ( (obj=c->object()) ) {
|
|
|
|
removeObjFromList( obj->senderObjects, this );
|
|
|
|
removeObjFromList( obj->senderObjects, this );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delete connections;
|
|
|
|
delete connections;
|
|
|
@ -691,6 +727,11 @@ TQObject::~TQObject()
|
|
|
|
delete childObjects;
|
|
|
|
delete childObjects;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
delete d->childObjectListMutex;
|
|
|
|
|
|
|
|
delete d->senderObjectListMutex;
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
delete d;
|
|
|
|
delete d;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -985,11 +1026,17 @@ bool TQObject::event( TQEvent *e )
|
|
|
|
TQSenderObjectList* sol;
|
|
|
|
TQSenderObjectList* sol;
|
|
|
|
TQObject* oldSender = 0;
|
|
|
|
TQObject* oldSender = 0;
|
|
|
|
sol = senderObjects;
|
|
|
|
sol = senderObjects;
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
if ( sol ) {
|
|
|
|
if ( sol ) {
|
|
|
|
oldSender = sol->currentSender;
|
|
|
|
oldSender = sol->currentSender;
|
|
|
|
sol->ref();
|
|
|
|
sol->ref();
|
|
|
|
sol->currentSender = metaEvent->sender();
|
|
|
|
sol->currentSender = metaEvent->sender();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
TQUObject *o = metaEvent->data();
|
|
|
|
TQUObject *o = metaEvent->data();
|
|
|
|
if (metaEvent->type() == TQMetaCallEvent::MetaCallEmit) {
|
|
|
|
if (metaEvent->type() == TQMetaCallEvent::MetaCallEmit) {
|
|
|
|
tqt_emit( metaEvent->id(), o );
|
|
|
|
tqt_emit( metaEvent->id(), o );
|
|
|
@ -997,12 +1044,20 @@ bool TQObject::event( TQEvent *e )
|
|
|
|
if (metaEvent->type() == TQMetaCallEvent::MetaCallInvoke) {
|
|
|
|
if (metaEvent->type() == TQMetaCallEvent::MetaCallInvoke) {
|
|
|
|
tqt_invoke( metaEvent->id(), o );
|
|
|
|
tqt_invoke( metaEvent->id(), o );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
if (sol ) {
|
|
|
|
if (sol ) {
|
|
|
|
sol->currentSender = oldSender;
|
|
|
|
sol->currentSender = oldSender;
|
|
|
|
if ( sol->deref() ) {
|
|
|
|
if ( sol->deref() ) {
|
|
|
|
|
|
|
|
sol->listMutex->unlock();
|
|
|
|
delete sol;
|
|
|
|
delete sol;
|
|
|
|
|
|
|
|
sol = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (sol) sol->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
tqWarning("TQObject: Ignoring metacall event from non-owning thread");
|
|
|
|
tqWarning("TQObject: Ignoring metacall event from non-owning thread");
|
|
|
@ -1509,6 +1564,10 @@ TQConnectionList *TQObject::receivers( int signal ) const
|
|
|
|
|
|
|
|
|
|
|
|
void TQObject::insertChild( TQObject *obj )
|
|
|
|
void TQObject::insertChild( TQObject *obj )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
TQMutexLocker locker( d->childObjectListMutex );
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
if ( obj->isTree ) {
|
|
|
|
if ( obj->isTree ) {
|
|
|
|
remove_tree( obj );
|
|
|
|
remove_tree( obj );
|
|
|
|
obj->isTree = FALSE;
|
|
|
|
obj->isTree = FALSE;
|
|
|
@ -1551,6 +1610,10 @@ void TQObject::insertChild( TQObject *obj )
|
|
|
|
|
|
|
|
|
|
|
|
void TQObject::removeChild( TQObject *obj )
|
|
|
|
void TQObject::removeChild( TQObject *obj )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
TQMutexLocker locker( d->childObjectListMutex );
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
if ( childObjects && childObjects->removeRef(obj) ) {
|
|
|
|
if ( childObjects && childObjects->removeRef(obj) ) {
|
|
|
|
obj->parentObj = 0;
|
|
|
|
obj->parentObj = 0;
|
|
|
|
if ( !obj->wasDeleted ) {
|
|
|
|
if ( !obj->wasDeleted ) {
|
|
|
@ -2135,9 +2198,25 @@ void TQObject::connectInternal( const TQObject *sender, int signal_index, const
|
|
|
|
TQConnection *c = new TQConnection( r, member_index, rm ? rm->name : "qt_invoke", membcode );
|
|
|
|
TQConnection *c = new TQConnection( r, member_index, rm ? rm->name : "qt_invoke", membcode );
|
|
|
|
TQ_CHECK_PTR( c );
|
|
|
|
TQ_CHECK_PTR( c );
|
|
|
|
clist->append( c );
|
|
|
|
clist->append( c );
|
|
|
|
if ( !r->senderObjects ) // create list of senders
|
|
|
|
if ( !r->senderObjects ) { // create list of senders
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
r->d->senderObjectListMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
r->senderObjects = new TQSenderObjectList;
|
|
|
|
r->senderObjects = new TQSenderObjectList;
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
r->senderObjects->listMutex->lock();
|
|
|
|
|
|
|
|
r->d->senderObjectListMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
r->senderObjects->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
}
|
|
|
|
r->senderObjects->append( s ); // add sender to list
|
|
|
|
r->senderObjects->append( s ); // add sender to list
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
r->senderObjects->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2343,13 +2422,25 @@ bool TQObject::disconnectInternal( const TQObject *sender, int signal_index,
|
|
|
|
c = clist->first();
|
|
|
|
c = clist->first();
|
|
|
|
while ( c ) { // for all receivers...
|
|
|
|
while ( c ) { // for all receivers...
|
|
|
|
if ( r == 0 ) { // remove all receivers
|
|
|
|
if ( r == 0 ) { // remove all receivers
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
removeObjFromList( c->object()->senderObjects, s );
|
|
|
|
removeObjFromList( c->object()->senderObjects, s );
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
success = TRUE;
|
|
|
|
success = TRUE;
|
|
|
|
c = clist->next();
|
|
|
|
c = clist->next();
|
|
|
|
} else if ( r == c->object() &&
|
|
|
|
} else if ( r == c->object() &&
|
|
|
|
( (member_index == -1) ||
|
|
|
|
( (member_index == -1) ||
|
|
|
|
((member_index == c->member()) && (c->memberType() == membcode)) ) ) {
|
|
|
|
((member_index == c->member()) && (c->memberType() == membcode)) ) ) {
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
removeObjFromList( c->object()->senderObjects, s, TRUE );
|
|
|
|
removeObjFromList( c->object()->senderObjects, s, TRUE );
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
success = TRUE;
|
|
|
|
success = TRUE;
|
|
|
|
clist->remove();
|
|
|
|
clist->remove();
|
|
|
|
c = clist->current();
|
|
|
|
c = clist->current();
|
|
|
@ -2368,13 +2459,25 @@ bool TQObject::disconnectInternal( const TQObject *sender, int signal_index,
|
|
|
|
c = clist->first();
|
|
|
|
c = clist->first();
|
|
|
|
while ( c ) { // for all receivers...
|
|
|
|
while ( c ) { // for all receivers...
|
|
|
|
if ( r == 0 ) { // remove all receivers
|
|
|
|
if ( r == 0 ) { // remove all receivers
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
removeObjFromList( c->object()->senderObjects, s, TRUE );
|
|
|
|
removeObjFromList( c->object()->senderObjects, s, TRUE );
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
success = TRUE;
|
|
|
|
success = TRUE;
|
|
|
|
c = clist->next();
|
|
|
|
c = clist->next();
|
|
|
|
} else if ( r == c->object() &&
|
|
|
|
} else if ( r == c->object() &&
|
|
|
|
( (member_index == -1) ||
|
|
|
|
( (member_index == -1) ||
|
|
|
|
((member_index == c->member()) && (c->memberType() == membcode)) ) ) {
|
|
|
|
((member_index == c->member()) && (c->memberType() == membcode)) ) ) {
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
removeObjFromList( c->object()->senderObjects, s, TRUE );
|
|
|
|
removeObjFromList( c->object()->senderObjects, s, TRUE );
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
success = TRUE;
|
|
|
|
success = TRUE;
|
|
|
|
clist->remove();
|
|
|
|
clist->remove();
|
|
|
|
c = clist->current();
|
|
|
|
c = clist->current();
|
|
|
@ -2382,8 +2485,9 @@ bool TQObject::disconnectInternal( const TQObject *sender, int signal_index,
|
|
|
|
c = clist->next();
|
|
|
|
c = clist->next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( r == 0 ) // disconnect all receivers
|
|
|
|
if ( r == 0 ) { // disconnect all receivers
|
|
|
|
s->connections->insert( signal_index, 0 );
|
|
|
|
s->connections->insert( signal_index, 0 );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2578,11 +2682,13 @@ void TQObject::activate_signal( int signal )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if ( !connections || signalsBlocked() || signal < 0 )
|
|
|
|
if ( !connections || signalsBlocked() || signal < 0 ) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
TQConnectionList *clist = connections->at( signal );
|
|
|
|
TQConnectionList *clist = connections->at( signal );
|
|
|
|
if ( !clist )
|
|
|
|
if ( !clist ) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
TQUObject o[1];
|
|
|
|
TQUObject o[1];
|
|
|
|
o[0].isLastObject = true;
|
|
|
|
o[0].isLastObject = true;
|
|
|
|
activate_signal( clist, o );
|
|
|
|
activate_signal( clist, o );
|
|
|
@ -2592,12 +2698,14 @@ void TQObject::activate_signal( int signal )
|
|
|
|
|
|
|
|
|
|
|
|
void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !clist )
|
|
|
|
if ( !clist ) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef QT_NO_PRELIMINARY_SIGNAL_SPY
|
|
|
|
#ifndef QT_NO_PRELIMINARY_SIGNAL_SPY
|
|
|
|
if ( tqt_preliminary_signal_spy )
|
|
|
|
if ( tqt_preliminary_signal_spy ) {
|
|
|
|
qt_spy_signal( this, connections->findRef( clist), o );
|
|
|
|
qt_spy_signal( this, connections->findRef( clist), o );
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
const TQThread *currentThread = TQThread::currentThreadObject();
|
|
|
|
const TQThread *currentThread = TQThread::currentThreadObject();
|
|
|
@ -2610,6 +2718,9 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
c = clist->first();
|
|
|
|
c = clist->first();
|
|
|
|
object = c->object();
|
|
|
|
object = c->object();
|
|
|
|
sol = object->senderObjects;
|
|
|
|
sol = object->senderObjects;
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
if ( sol ) {
|
|
|
|
if ( sol ) {
|
|
|
|
oldSender = sol->currentSender;
|
|
|
|
oldSender = sol->currentSender;
|
|
|
|
sol->ref();
|
|
|
|
sol->ref();
|
|
|
@ -2617,7 +2728,13 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( c->memberType() == TQSIGNAL_CODE ) {
|
|
|
|
if ( c->memberType() == TQSIGNAL_CODE ) {
|
|
|
|
if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
|
|
|
|
if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
object->tqt_emit( c->member(), o );
|
|
|
|
object->tqt_emit( c->member(), o );
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if (object->d->ownThread && !object->d->ownThread->finished()) {
|
|
|
|
if (object->d->ownThread && !object->d->ownThread->finished()) {
|
|
|
@ -2627,7 +2744,13 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
|
|
|
|
if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
object->tqt_invoke( c->member(), o );
|
|
|
|
object->tqt_invoke( c->member(), o );
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if (object->d->ownThread && !object->d->ownThread->finished()) {
|
|
|
|
if (object->d->ownThread && !object->d->ownThread->finished()) {
|
|
|
@ -2637,9 +2760,15 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( sol ) {
|
|
|
|
if ( sol ) {
|
|
|
|
sol->currentSender = oldSender;
|
|
|
|
sol->currentSender = oldSender;
|
|
|
|
if ( sol->deref() )
|
|
|
|
if ( sol->deref() ) {
|
|
|
|
|
|
|
|
sol->listMutex->unlock();
|
|
|
|
delete sol;
|
|
|
|
delete sol;
|
|
|
|
|
|
|
|
sol = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (sol) sol->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
TQConnection *cd = 0;
|
|
|
|
TQConnection *cd = 0;
|
|
|
|
TQConnectionListIt it(*clist);
|
|
|
|
TQConnectionListIt it(*clist);
|
|
|
@ -2650,6 +2779,9 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
cd = c;
|
|
|
|
cd = c;
|
|
|
|
object = c->object();
|
|
|
|
object = c->object();
|
|
|
|
sol = object->senderObjects;
|
|
|
|
sol = object->senderObjects;
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
if ( sol ) {
|
|
|
|
if ( sol ) {
|
|
|
|
oldSender = sol->currentSender;
|
|
|
|
oldSender = sol->currentSender;
|
|
|
|
sol->ref();
|
|
|
|
sol->ref();
|
|
|
@ -2657,7 +2789,13 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( c->memberType() == TQSIGNAL_CODE ) {
|
|
|
|
if ( c->memberType() == TQSIGNAL_CODE ) {
|
|
|
|
if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
|
|
|
|
if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
object->tqt_emit( c->member(), o );
|
|
|
|
object->tqt_emit( c->member(), o );
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if (object->d->ownThread && !object->d->ownThread->finished()) {
|
|
|
|
if (object->d->ownThread && !object->d->ownThread->finished()) {
|
|
|
@ -2667,7 +2805,13 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
|
|
|
|
if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
object->tqt_invoke( c->member(), o );
|
|
|
|
object->tqt_invoke( c->member(), o );
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
sol->listMutex->lock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if (object->d->ownThread && !object->d->ownThread->finished()) {
|
|
|
|
if (object->d->ownThread && !object->d->ownThread->finished()) {
|
|
|
@ -2677,9 +2821,15 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sol ) {
|
|
|
|
if (sol ) {
|
|
|
|
sol->currentSender = oldSender;
|
|
|
|
sol->currentSender = oldSender;
|
|
|
|
if ( sol->deref() )
|
|
|
|
if ( sol->deref() ) {
|
|
|
|
|
|
|
|
sol->listMutex->unlock();
|
|
|
|
delete sol;
|
|
|
|
delete sol;
|
|
|
|
|
|
|
|
sol = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
if (sol) sol->listMutex->unlock();
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2818,6 +2968,10 @@ void TQObject::dumpObjectTree()
|
|
|
|
|
|
|
|
|
|
|
|
void TQObject::dumpObjectInfo()
|
|
|
|
void TQObject::dumpObjectInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifdef QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
TQMutexLocker locker( d->senderObjectListMutex );
|
|
|
|
|
|
|
|
#endif // QT_THREAD_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(QT_DEBUG)
|
|
|
|
#if defined(QT_DEBUG)
|
|
|
|
tqDebug( "OBJECT %s::%s", className(), name( "unnamed" ) );
|
|
|
|
tqDebug( "OBJECT %s::%s", className(), name( "unnamed" ) );
|
|
|
|
int n = 0;
|
|
|
|
int n = 0;
|
|
|
@ -2852,8 +3006,9 @@ void TQObject::dumpObjectInfo()
|
|
|
|
sender = senderObjects->next();
|
|
|
|
sender = senderObjects->next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( n == 0 )
|
|
|
|
if ( n == 0 ) {
|
|
|
|
tqDebug( "\t<None>" );
|
|
|
|
tqDebug( "\t<None>" );
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|