TaskTree: Unify TaskInterface::done(DoneResult) signal

Change the argument of TaskInterface::done() signal
from bool into DoneResult. Make it consistent with
other TaskTree API.

Introduce toDoneResult(bool success) helper.

Change-Id: I7b3041d7c1ed0317c76adbc1fd37448231e85f82
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-11-15 10:33:31 +01:00
parent 6f3bc431fc
commit 659f0f000c
39 changed files with 191 additions and 160 deletions

View File

@@ -16,13 +16,13 @@ void NetworkQuery::start()
if (!m_manager) {
qWarning("Can't start the NetworkQuery without the QNetworkAccessManager. "
"Stopping with an error.");
emit done(false);
emit done(DoneResult::Error);
return;
}
m_reply.reset(m_manager->get(m_request));
connect(m_reply.get(), &QNetworkReply::finished, this, [this] {
disconnect(m_reply.get(), nullptr, this, nullptr);
emit done(m_reply->error() == QNetworkReply::NoError);
emit done(toDoneResult(m_reply->error() == QNetworkReply::NoError));
m_reply.release()->deleteLater();
});
if (m_reply->isRunning())