Example #1
0
void QQmlThreadPrivate::threadEvent() 
{
    lock();

    if (m_shutdown) {
        quit();
        wakeOne();
        unlock();
        q->shutdownThread();
    } else {
        m_threadProcessing = true;

        while (!threadList.isEmpty()) {
            QQmlThread::Message *message = threadList.first();

            unlock();

            message->call(q);

            lock();

            delete threadList.takeFirst();
        }

        wakeOne();

        m_threadProcessing = false;

        unlock();
    }
}
Example #2
0
void QQmlThreadPrivate::threadEvent()
{
    lock();

    for (;;) {
        if (m_shutdown) {
            quit();
            wakeOne();
            unlock();

            return;
        } else if (!threadList.isEmpty()) {
            m_threadProcessing = true;

            QQmlThread::Message *message = threadList.first();

            unlock();

            message->call(q);

            lock();

            delete threadList.takeFirst();
        } else {
            wakeOne();

            m_threadProcessing = false;

            unlock();

            return;
        }
    }
}
Example #3
0
VWallSession::VWallSession(const QString& id, VAccount* account): Conference(account), d_ptr(new VWallSessionPrivate)
{
    Q_D(VWallSession);
    d->q_ptr = this;
    d->id = id;
    d->me = account->getContact(account->uid(),true);
    d->me->setContactName(account->name());
    d->owner = d->account()->getContact(d->id,true);
    d->historyCount = 10;

    MessageList list = History().read(this,1);
    if (list.count())
        d->timeStamp = list.first().time().toTime_t();
    d->updateTimer.setInterval(5000);

    connect(&d->updateTimer,SIGNAL(timeout()),d,SLOT(getHistory()));
    connect(d->owner,SIGNAL(destroyed()),SLOT(deleteLater()));
}