示例#1
0
IcalImportThread::IcalImportThread(const int inThreadId, const QStringList &inContentLines, QObject* parent )
    :
      QThread(parent),
      m_threadId(inThreadId),
      m_contentLines( inContentLines )
{
    // we connect this insode of this class, because we want append
    // the threadID
    connect( this, SIGNAL(finished()), this, SLOT(slotThreadFinished()) );
}
示例#2
0
/**
 * @brief GPS-correlate items
 */
void TrackCorrelator::correlate(const Correlation::List& itemsToCorrelate, const CorrelationOptions& options)
{
    d->thread                   = new TrackCorrelatorThread(this);
    d->thread->options          = options;
    d->thread->fileList         = d->trackManager->getTrackList();
    d->thread->itemsToCorrelate = itemsToCorrelate;

    connect(d->thread, SIGNAL(signalItemsCorrelated(Digikam::TrackCorrelator::Correlation::List)),
            this, SLOT(slotThreadItemsCorrelated(Digikam::TrackCorrelator::Correlation::List)), Qt::QueuedConnection);

    connect(d->thread, SIGNAL(finished()),
            this, SLOT(slotThreadFinished()), Qt::QueuedConnection);

    d->thread->start();
}
int SslServer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QTcpServer::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotThreadFinished(); break;
        case 1: slotQuitThread(); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
示例#4
0
void SD::start()
{
    QAtomicInt currentId( 0 );
    int numThreads = GLFunctions::idealThreadCount;

    // create threads
    for ( int i = 0; i < numThreads; ++i )
    {
        SDThread* t = new SDThread( m_dataset, i );
        m_threads.push_back( t );
        connect( t, SIGNAL( progress() ), this, SLOT( slotProgress() ), Qt::QueuedConnection );
        connect( t, SIGNAL( finished() ), this, SLOT( slotThreadFinished() ), Qt::QueuedConnection );
    }

    // run threads
    for ( int i = 0; i < numThreads; ++i )
    {
        ++m_threadsRunning;
        m_threads[i]->start();
    }
}
示例#5
0
void SslServer::incomingConnection(int socketDescriptor)
{
    //
    // A new connection is incomming, create a new connection object and append it to the connection list
    //
    SslServerConnection *newIncommingConnection = new SslServerConnection (socketDescriptor, &mutex, this);

    // Add the connection to the current connected list
    this->connections->add(newIncommingConnection);

    // When we receives the connectionIsClosed signal we exit the eventloop in the thread
    QObject::connect(newIncommingConnection, SIGNAL(connectionIsClosed()), this, SLOT(slotQuitThread()));
    // When the thread is finished cleanup
    QObject::connect(newIncommingConnection, SIGNAL(finished()), this, SLOT(slotThreadFinished()));
    // Received a disconnect from the service
    QObject::connect(newIncommingConnection, SIGNAL(setDisconnected(int)), this, SIGNAL(setDisconnected(int)));
    // Received an error from the service
    QObject::connect(newIncommingConnection, SIGNAL(setError(int,QString)), this, SIGNAL(setError(int,QString)));
    // Received a user input is needed
    QObject::connect(newIncommingConnection, SIGNAL(needUserInput(int,int)), this, SIGNAL(needUserInput(int,int)));
    // Received a dummy response
    QObject::connect(newIncommingConnection, SIGNAL(receivedDummy()), this, SIGNAL(receivedDummy()));
    // Connection is stable
    QObject::connect(newIncommingConnection, SIGNAL(receivedIP(int,QString)), this, SIGNAL(receivedIP(int,QString)));
    // Connection is reconnecting
    QObject::connect(newIncommingConnection, SIGNAL(receivedReconnect(int)), this, SIGNAL(receivedReconnect(int)));
    // Tap install controll
    QObject::connect(newIncommingConnection, SIGNAL(receivedTapControl(int)), this, SIGNAL(receivedTapControl(int)));
    // Tap remove controll
    QObject::connect(newIncommingConnection, SIGNAL(receivedRemoveTap(QString)), this, SIGNAL(receivedRemoveTap(QString)));

    QObject::connect(newIncommingConnection, SIGNAL(receivedTapCount(int)), this, SIGNAL(receivedTapCount(int)));

    // Received a status
    QObject::connect(newIncommingConnection, SIGNAL(receivedStatus(int,bool,bool,int,QString)), this, SIGNAL(receivedStatus(int,bool,bool,int,QString)));

    // Start thread now
    newIncommingConnection->start(QThread::NormalPriority);
}
示例#6
0
MaintenanceThread::MaintenanceThread(QObject* const parent)
    : RActionThreadBase(parent)
{
    connect(this, SIGNAL(finished()),
            this, SLOT(slotThreadFinished()));
}