示例#1
0
/**
 * This function provides a programmatic means of creating a ServiceManager
 * object.
 *
 * @param  host  A reference to the host that the service manager will connect
 *               to.
 *
 * @return  A reference to the newly created ServiceManager object.
 *
 */
VALUE rb_service_manager_new(VALUE host) {
  VALUE manager = allocateServiceManager(cServiceManager);

  initializeServiceManager(manager, host);

  return(manager);
}
/*!
    Constructs a new TestabilityService with \a parent.
 */
TestabilityService::TestabilityService(QObject* parent)
    : QObject(parent)
{        
    mMessageId = 0;
    mPaintEventCounter = 0;
    mServiceManager = 0;

    mConnected = false;
    mRegistered = false;   
       
    mPluginId = QString::number(qApp->applicationPid());

    initializeServiceManager();
    initializeConnections();

    mRegisterTime.setSingleShot(true);
    connect(&mRegisterTime, SIGNAL(timeout()), this, SLOT(timeout()));
    loadStartUpParams(TestabilityUtils::getApplicationName());

    mRegisterWatchDog.setSingleShot(true);

    //track paints and register after the first 300 millis pause
    qApp->installEventFilter(this);
    mPaintTracker.setSingleShot(true);
    connect(&mPaintTracker, SIGNAL(timeout()), this, SLOT(registerPlugin()));

    //After 5 secs force register
    mRegisterWatchDog.start(5000);
    connect(&mRegisterWatchDog, SIGNAL(timeout()), this, SLOT(registerPlugin()));
}