bool BatchExtract::doKill() { if (subjobs().isEmpty()) { return false; } return subjobs().first()->kill(); }
void Task::start() { kDebug(14010) << "Executing children tasks for this task."; KJob *subTask = 0; foreach( subTask, subjobs() ) { subTask->start(); } }
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); } } }
{ if (m_inputs.isEmpty()) { emitResult(); return; } foreach (const auto& url, m_inputs) { addExtraction(url); } KIO::getJobTracker()->registerJob(this); m_registered = true; emit description(this, i18n("Extracting Files"), qMakePair(i18n("Source archive"), m_fileNames.value(subjobs().at(0)).first), qMakePair(i18n("Destination"), m_fileNames.value(subjobs().at(0)).second) ); m_initialJobCount = subjobs().size(); qCDebug(ARK) << "Starting first job"; subjobs().at(0)->start(); } void BatchExtract::showFailedFiles() { if (!m_failedFiles.isEmpty()) { KMessageBox::informationList(0, i18n("The following files could not be extracted:"), m_failedFiles); }