void start() override { setError(!m_error.isEmpty()); setErrorText(m_error); emitResult(); }
void BackendJob::dismiss() { m_dismissed = true; deleteLater(); emitResult(); }
void WaitJob::kill(bool) { m_error = 0; emitResult(); }
void WaitJob::timerDone() { // set the error to null and emit the result m_error = 0; emitResult(); }
void ListJob::done( ThreadWeaver::Job *job ) { emitResult(); }
void ExtractJob::done( ThreadWeaver::Job *job ) { emitResult(); }
void UPowerSuspendJob::resumeDone() { emitResult(); }
void DeleteJob::done( ThreadWeaver::Job *job ) { emitResult(); }
void MockJob::done() { emitResult(); }
void Kopete::Transfer::slotContactDestroyed() { setError( KIO::ERR_USER_CANCELED ); emitResult(); }
void QueryImages::doWorkProcessReply() { Q_D(QueryImages); disconnect(d->reply, SIGNAL(finished()), this, SLOT(doWorkProcessReply())); if (d->reply->error() == QNetworkReply::NoError) { QList<Image> imagesReceived; d->imcontinue.clear(); QXmlStreamReader reader(d->reply); while (!reader.atEnd() && !reader.hasError()) { QXmlStreamReader::TokenType token = reader.readNext(); if (token == QXmlStreamReader::StartElement) { if (reader.name() == "images") { if (reader.attributes().value("imcontinue").isNull()) { imagesReceived.clear(); } else { d->imcontinue = reader.attributes().value("imcontinue").toString(); } } else if (reader.name() == "im") { Image image; image.setNamespaceId( reader.attributes().value("ns").toString().toUInt()); image.setTitle(reader.attributes().value("title").toString()); imagesReceived.push_back(image); } } } if (!reader.hasError()) { emit images(imagesReceived); if (!d->imcontinue.isNull()) { QTimer::singleShot(0, this, SLOT(doWorkSendRequest())); return; } else { setError(KJob::NoError); } } else { setError(QueryImages::XmlError); } } else { setError(QueryImages::NetworkError); } emitResult(); }
void DownloadJob::disconnected() { //kDebug(kdeconnect_kded()) << "DownloadJob End"; emitResult(); }
void PlayerActionJob::start() { const QString operation(operationName()); kDebug() << "Trying to perform the action" << operationName(); if (!m_controller->isOperationEnabled(operation)) { setError(Denied); emitResult(); return; } if (operation == QLatin1String("Quit") || operation == QLatin1String("Raise") || operation == QLatin1String("SetFullscreen")) { listenToCall(m_controller->rootInterface()->asyncCall(operation)); } else if (operation == QLatin1String("Play") || operation == QLatin1String("Pause") || operation == QLatin1String("PlayPause") || operation == QLatin1String("Stop") || operation == QLatin1String("Next") || operation == QLatin1String("Previous")) { listenToCall(m_controller->playerInterface()->asyncCall(operation)); } else if (operation == "Seek") { if (parameters().value("microseconds").type() == QVariant::LongLong) { listenToCall(m_controller->playerInterface()->asyncCall(operation, parameters()["microseconds"])); } else { setErrorText("microseconds"); setError(MissingArgument); emitResult(); } } else if (operation == "SetPosition") { if (parameters().value("microseconds").type() == QVariant::LongLong) { listenToCall(m_controller->playerInterface()->asyncCall(operation, m_controller->trackId(), parameters()["microseconds"])); } else { setErrorText("microseconds"); setError(MissingArgument); emitResult(); } } else if (operation == "OpenUri") { if (parameters().value("uri").canConvert<KUrl>()) { listenToCall(m_controller->playerInterface()->asyncCall(operation, QString::fromLatin1(parameters()["uri"].toUrl().toEncoded()))); } else { kDebug() << "uri was of type" << parameters().value("uri").userType(); setErrorText("uri"); setError(MissingArgument); emitResult(); } } else if (operation == "SetLoopStatus") { if (parameters().value("status").type() == QVariant::String) { setDBusProperty(m_controller->playerInterface()->interface(), "LoopStatus", QDBusVariant(parameters()["status"])); } else { setErrorText("status"); setError(MissingArgument); emitResult(); } } else if (operation == "SetShuffle") { if (parameters().value("on").type() == QVariant::Bool) { setDBusProperty(m_controller->playerInterface()->interface(), "Shuffle", QDBusVariant(parameters()["on"])); } else { setErrorText("on"); setError(MissingArgument); emitResult(); } } else if (operation == "SetRate") { if (parameters().value("rate").type() == QVariant::Double) { setDBusProperty(m_controller->playerInterface()->interface(), "Rate", QDBusVariant(parameters()["rate"])); } else { setErrorText("rate"); setError(MissingArgument); emitResult(); } } else if (operation == "SetVolume") { if (parameters().value("level").type() == QVariant::Double) { setDBusProperty(m_controller->playerInterface()->interface(), "Volume", QDBusVariant(parameters()["level"])); } else { setErrorText("level"); setError(MissingArgument); emitResult(); } } else { setError(UnknownOperation); emitResult(); } }