Source Code (Use browser search to find items of interest.)

Class Index

empath'EmpathJobScheduler (./kdepim/empath/lib/EmpathJobScheduler.h:35)

class EmpathJobScheduler : public QObject
{
    Q_OBJECT

    public:

        EmpathJobScheduler();

        virtual ~EmpathJobScheduler();

        EmpathJobID newWriteJob(
            RMM::RMessage &,
            const EmpathURL &,
            QObject *,
            const char *
        );

        EmpathJobID newRetrieveJob(
            const EmpathURL &,
            QObject *,
            const char *
        );

        EmpathJobID newCopyJob(
            const EmpathURL &,
            const EmpathURL &,
            QObject *,
            const char *
        );

        EmpathJobID newMoveJob(
            const EmpathURL &,
            const EmpathURL &,
            QObject *,
            const char *
        );

        EmpathJobID newRemoveJob(
            const EmpathURL &,
            QObject *,
            const char *
        );

        EmpathJobID newRemoveJob(
            const EmpathURL &,
            const QStringList &,
            QObject *,
            const char *
        );

        EmpathJobID newMarkJob(
            const EmpathURL &,
            EmpathIndexRecord::Status,
            QObject *,
            const char *
        );

        EmpathJobID newMarkJob(
            const EmpathURL &,
            const QStringList &,
            EmpathIndexRecord::Status,
            QObject *,
            const char *
        );

        EmpathJobID newCreateFolderJob(
            const EmpathURL &,
            QObject *,
            const char *
        );

        EmpathJobID newRemoveFolderJob(
            const EmpathURL &,
            QObject *,
            const char *
        );

    protected:

        void timerEvent(QTimerEvent *);

    private:

        EmpathJobID _enqueue(EmpathJob *);

        void _runQueue();

        QQueue<EmpathJob> queue_;
};

#endif
// vim:ts=4:sw=4:tw=78

empath'EmpathJobScheduler::EmpathJobScheduler() (./kdepim/empath/lib/EmpathJobScheduler.cpp:28)

EmpathJobScheduler::EmpathJobScheduler()
{
    // Empty.
}


empath'EmpathJobScheduler::~EmpathJobScheduler() (./kdepim/empath/lib/EmpathJobScheduler.cpp:33)

EmpathJobScheduler::~EmpathJobScheduler()
{
    // Empty.
}

    EmpathJobID

empath'EmpathJobScheduler::newWriteJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:39)

EmpathJobScheduler::newWriteJob(
    RMM::RMessage & message,
    const EmpathURL & url,
    QObject * o,
    const char * slot
)
{
    EmpathWriteJob * j = new EmpathWriteJob(message, url);

    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathWriteJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathWriteJob)),
                o,  SLOT(s_writeJobFinished(EmpathWriteJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newRetrieveJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:64)

EmpathJobScheduler::newRetrieveJob(
    const EmpathURL & url,
    QObject * o,
    const char * slot
)
{
    EmpathRetrieveJob * j = new EmpathRetrieveJob(url);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathRetrieveJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathRetrieveJob)),
                o,  SLOT(s_retrieveJobFinished(EmpathRetrieveJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newCopyJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:88)

EmpathJobScheduler::newCopyJob(
    const EmpathURL & source,
    const EmpathURL & destination,
    QObject * o,
    const char * slot
)
{
    EmpathCopyJob * j = new EmpathCopyJob(source, destination);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathCopyJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathCopyJob)),
                o,  SLOT(s_copyJobFinished(EmpathCopyJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newMoveJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:113)

EmpathJobScheduler::newMoveJob(
    const EmpathURL & source,
    const EmpathURL & destination,
    QObject * o,
    const char * slot
)
{
    EmpathMoveJob * j = new EmpathMoveJob(source, destination);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathMoveJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathMoveJob)),
                o,  SLOT(s_moveJobFinished(EmpathMoveJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newRemoveJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:138)

EmpathJobScheduler::newRemoveJob(
    const EmpathURL & url,
    QObject * o,
    const char * slot
)
{
    EmpathRemoveJob * j = new EmpathRemoveJob(url);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathRemoveJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathRemoveJob)),
                o,  SLOT(s_removeJobFinished(EmpathRemoveJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newRemoveJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:162)

EmpathJobScheduler::newRemoveJob(
    const EmpathURL & folder,
    const QStringList & idList,
    QObject * o,
    const char * slot
)
{
    EmpathRemoveJob * j = new EmpathRemoveJob(folder, idList);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathRemoveJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathRemoveJob)),
                o,  SLOT(s_removeJobFinished(EmpathRemoveJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newMarkJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:187)

EmpathJobScheduler::newMarkJob(
    const EmpathURL & url,
    EmpathIndexRecord::Status status,
    QObject * o,
    const char * slot
)
{
    EmpathMarkJob * j = new EmpathMarkJob(url, status);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathMarkJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathMarkJob)),
                o,  SLOT(s_markJobFinished(EmpathMarkJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newMarkJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:212)

EmpathJobScheduler::newMarkJob(
    const EmpathURL & folder,
    const QStringList & idList,
    EmpathIndexRecord::Status status,
    QObject * o,
    const char * slot
)
{
    EmpathMarkJob * j = new EmpathMarkJob(folder, idList, status);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathMarkJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathMarkJob)),
                o,  SLOT(s_markJobFinished(EmpathMarkJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newCreateFolderJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:238)

EmpathJobScheduler::newCreateFolderJob(
    const EmpathURL & url,
    QObject * o,
    const char * slot
)
{
    EmpathCreateFolderJob * j = new EmpathCreateFolderJob(url);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathCreateFolderJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathCreateFolderJob)),
                o,  SLOT(s_createFolderJobFinished(EmpathCreateFolderJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::newRemoveFolderJob() (./kdepim/empath/lib/EmpathJobScheduler.cpp:262)

EmpathJobScheduler::newRemoveFolderJob(
    const EmpathURL & url,
    QObject * o,
    const char * slot
)
{
    EmpathRemoveFolderJob * j = new EmpathRemoveFolderJob(url);
    
    if (0 != o)
        if (0 != slot)
            QObject::connect(
                j,  SIGNAL(done(EmpathRemoveFolderJob)),
                o,  slot);
        else
            QObject::connect(
                j,  SIGNAL(done(EmpathRemoveFolderJob)),
                o,  SLOT(s_removeFolderJobFinished(EmpathRemoveFolderJob)));

    _enqueue(j);

    return j->id();
}

    EmpathJobID

empath'EmpathJobScheduler::_enqueue() (./kdepim/empath/lib/EmpathJobScheduler.cpp:286)

EmpathJobScheduler::_enqueue(EmpathJob * j)
{
    queue_.enqueue(j);
    startTimer(0);
    return j->id();
}

    void

empath'EmpathJobScheduler::timerEvent() (./kdepim/empath/lib/EmpathJobScheduler.cpp:294)

EmpathJobScheduler::timerEvent(QTimerEvent *)
{
    killTimers();
    _runQueue();
}

    void

empath'EmpathJobScheduler::_runQueue() (./kdepim/empath/lib/EmpathJobScheduler.cpp:301)

EmpathJobScheduler::_runQueue()
{
    if (!queue_.isEmpty()) {

        EmpathJob * j = queue_.dequeue();

        if (!j->finished())
            j->run();

        else {

            delete j;
            j = 0;
            _runQueue();
        }
    }
}

// vim:ts=4:sw=4:tw=78