bool QSingleShotTimer::start( int msec, QObject *r, const char *m ) { timerId = 0; if ( signal.connect(r, m) ) timerId = qStartTimer( msec, (QObject *)this ); return timerId != 0; }
void Dispatcher::registerInstance( KInstance * instance, QObject * recv, const char * slot ) { assert( instance != 0 ); // keep the KInstance around and call // instance->config()->reparseConfiguration when the app should reparse QCString instanceName = instance->instanceName(); kdDebug( 701 ) << k_funcinfo << instanceName << endl; m_instanceName[ recv ] = instanceName; QSignal * sig; if( m_instanceInfo.contains( instanceName ) ) { sig = m_instanceInfo[ instanceName ].signal; } else { sig = new QSignal( this, "signal dispatcher" ); m_instanceInfo[ instanceName ].signal = sig; m_instanceInfo[ instanceName ].instance = instance; } sig->connect( recv, slot ); ++m_instanceInfo[ instanceName ].count; connect( recv, SIGNAL( destroyed( QObject * ) ), this, SLOT( unregisterInstance( QObject * ) ) ); }