示例#1
0
void KonqMultiRestoreJob::slotResult(KJob *job)
{
    if (job->error()) {
        KIO::Job::slotResult(job);   // will set the error and emit result(this)
        return;
    }
    removeSubjob(job);
    // Move on to next one
    ++m_urlsIterator;
    ++m_progress;
    //emit processedSize( this, m_progress );
    emitPercent(m_progress, m_urls.count());
    slotStart();
}
ThumbnailLoadJob::~ThumbnailLoadJob()
{
    LOG(this);
    if (hasSubjobs()) {
        LOG("Killing subjob");
        KJob* job = subjobs().first();
        job->kill();
        removeSubjob(job);
    }
    mThumbnailThread.cancel();
    mThumbnailThread.wait();
    if (!sThumbnailCache->isRunning()) {
        sThumbnailCache->start();
    }
}
void ThumbnailLoadJob::removeItems(const KFileItemList& itemList)
{
    Q_FOREACH(const KFileItem & item, itemList) {
        // If we are removing the next item, update to be the item after or the
        // first if we removed the last item
        mItems.removeAll(item);

        if (item == mCurrentItem) {
            // Abort current item
            mCurrentItem = KFileItem();
            if (hasSubjobs()) {
                KJob* job = subjobs().first();
                job->kill();
                removeSubjob(job);
            }
        }
    }