Commit 4b683741 authored by Jaime Torres Amate's avatar Jaime Torres Amate
Browse files

Avoid a double emitResult()

Summary:
ServiceJob::setResult already does a emitResult.
Discovered with the assert created in https://phabricator.kde.org/D9862

Reviewers: #frameworks, #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10629
parent 8227e4e2
......@@ -74,6 +74,7 @@ void NotificationAction::start()
parameters().value(QStringLiteral("actions")).toStringList(),
hints);
setResult(rv);
return;
} else if (operationName() == QLatin1String("configureNotification")) {
m_engine->configureNotification(parameters()[QStringLiteral("appRealName")].toString(),
parameters()[QStringLiteral("eventId")].toString());
......@@ -82,6 +83,7 @@ void NotificationAction::start()
const QString value = parameters()[QStringLiteral("value")].toString();
auto t = m_engine->createInhibition(hint, value);
setResult(QVariant::fromValue(t));
return;
}
emitResult();
......
......@@ -50,12 +50,10 @@ void ClipboardJob::start()
if (operation == QLatin1String("clearHistory")) {
m_klipper->slotAskClearHistory();
setResult(true);
emitResult();
return;
} else if (operation == QLatin1String("configureKlipper")) {
m_klipper->slotConfigure();
setResult(true);
emitResult();
return;
}
......@@ -63,7 +61,6 @@ void ClipboardJob::start()
HistoryItemConstPtr item = m_klipper->history()->find(QByteArray::fromBase64(destination().toUtf8()));
if (item.isNull()) {
setResult(false);
emitResult();
return;
}
if (operation == QLatin1String("select")) {
......@@ -80,7 +77,6 @@ void ClipboardJob::start()
return;
}
setResult(result);
emitResult();
}
);
m_klipper->editData(item);
......@@ -127,7 +123,6 @@ void ClipboardJob::start()
setResult(watcher->result());
watcher->deleteLater();
delete code;
emitResult();
}
);
auto future = QtConcurrent::run(code, &Prison::AbstractBarcode::toImage, QSizeF(pixelWidth, pixelHeight));
......@@ -176,7 +171,6 @@ void ClipboardJob::start()
res.insert(s_previewWidthKey, preview.size().width());
res.insert(s_previewHeightKey, preview.size().height());
setResult(res);
emitResult();
}
);
connect(job, &KIO::PreviewJob::failed, this,
......@@ -205,5 +199,4 @@ void ClipboardJob::iconResult(const KFileItem& item)
res.insert(s_previewWidthKey, pix.size().width());
res.insert(s_previewHeightKey, pix.size().height());
setResult(res);
emitResult();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment