void RetrieveCollectionsTask::onMailBoxesReceiveDone(KJob *job) { if (job->error()) { cancelTask(job->errorString()); } else { collectionsRetrieved(Akonadi::valuesToVector(m_reportedCollections)); } }
void TagChangeHelper::onModifyDone(KJob *job) { if (job->error()) { qCWarning(KOLABRESOURCE_LOG) << "Modify failed: " << job->errorString(); Q_EMIT cancelTask(job->errorString()); return; } Q_EMIT changeCommitted(); }
void SearchTask::onSelectDone(KJob *job) { if (job->error()) { searchFinished(QVector<qint64>()); cancelTask(job->errorText()); return; } doSearch(qobject_cast<KIMAP::SelectJob *>(job)->session()); }
void ResourceTask::onPoolDisconnect() { // All the sessions in the pool we used changed, // so get rid of the pointer, we don't need to // release our session anymore m_pool = Q_NULLPTR; Trace() << metaObject()->className(); cancelTask(i18n("Connection lost")); }
void ResourceTask::onConnectionLost(KIMAP::Session *session) { if (session == m_session) { // Our session becomes invalid, so get rid of // the pointer, we don't need to release it once the // task is done m_session = Q_NULLPTR; Trace() << metaObject()->className(); cancelTask(i18n("Connection lost")); } }
void TagChangeHelper::onReplaceDone(KJob *job) { if (job->error()) { qCWarning(KOLABRESOURCE_LOG) << "Replace failed: " << job->errorString(); } UpdateMessageJob *replaceJob = static_cast<UpdateMessageJob *>(job); const qint64 newUid = replaceJob->newUid(); const Akonadi::Tag tag = job->property("tag").value<Akonadi::Tag>(); if (newUid > 0) { recordNewUid(newUid, tag); } else { Q_EMIT cancelTask(job->errorString()); } }
void MoveCollectionTask::onRenameDone(KJob *job) { if (job->error()) { cancelTask(job->errorString()); } else { // Automatically subscribe to the new mailbox name KIMAP::RenameJob *rename = static_cast<KIMAP::RenameJob *>(job); KIMAP::SubscribeJob *subscribe = new KIMAP::SubscribeJob(rename->session()); subscribe->setMailBox(rename->destinationMailBox()); connect(subscribe, &KIMAP::SubscribeJob::result, this, &MoveCollectionTask::onSubscribeDone); subscribe->start(); } }
void CloneTasksTableView::createContextMenu() { context_menu_ = new QMenu(this); cancel_task_action_ = new QAction(tr("Cancel this task"), this); cancel_task_action_->setIcon(awesome->icon(icon_remove)); cancel_task_action_->setStatusTip(tr("cancel this task")); cancel_task_action_->setIconVisibleInMenu(true); connect(cancel_task_action_, SIGNAL(triggered()), this, SLOT(cancelTask())); context_menu_->addAction(cancel_task_action_); remove_task_action_ = new QAction(tr("Remove this task"), this); remove_task_action_->setIcon(awesome->icon(icon_remove)); remove_task_action_->setStatusTip(tr("Remove this task")); remove_task_action_->setIconVisibleInMenu(true); connect(remove_task_action_, SIGNAL(triggered()), this, SLOT(removeTask())); context_menu_->addAction(remove_task_action_); }
void AddCollectionTask::onCreateDone(KJob *job) { if (job->error()) { qCWarning(IMAPRESOURCE_LOG) << "Failed to create folder on server: " << job->errorString(); emitError(i18n("Failed to create the folder '%1' on the IMAP server. ", m_collection.name())); cancelTask(job->errorString()); } else { // Automatically subscribe to newly created mailbox KIMAP::CreateJob *create = static_cast<KIMAP::CreateJob *>(job); KIMAP::SubscribeJob *subscribe = new KIMAP::SubscribeJob(create->session()); subscribe->setMailBox(create->mailBox()); connect(subscribe, &KIMAP::SubscribeJob::result, this, &AddCollectionTask::onSubscribeDone); subscribe->start(); } }
void Node::cancelTasks(const Files &files) { for (auto &i : files) for (auto &q : i.second) cancelTask(q); }
void ResourceTask::kill() { Trace() << metaObject()->className(); qCDebug(IMAPRESOURCE_LOG); cancelTask(i18n("killed")); }
void interrupt() { printf(">> interrupt <<\n"); // always cancel task1, normally find Task + cancel cancelTask(1); }