aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2023-11-15 10:33:31 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2023-11-17 09:44:20 +0000
commit659f0f000c7e41210f5318d67ed23ee68c7dc16b (patch)
tree147417a45ed388e929f5fc61519c75ed157cdd8b
parent6f3bc431fc5a0bcde258f53d8c6e1d2d5ad80539 (diff)
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>
-rw-r--r--src/libs/solutions/tasking/barrier.cpp10
-rw-r--r--src/libs/solutions/tasking/barrier.h16
-rw-r--r--src/libs/solutions/tasking/concurrentcall.h4
-rw-r--r--src/libs/solutions/tasking/networkquery.cpp4
-rw-r--r--src/libs/solutions/tasking/networkquery.h2
-rw-r--r--src/libs/solutions/tasking/qprocesstask.h4
-rw-r--r--src/libs/solutions/tasking/tasktree.cpp21
-rw-r--r--src/libs/solutions/tasking/tasktree.h114
-rw-r--r--src/libs/utils/async.h2
-rw-r--r--src/libs/utils/filestreamer.cpp11
-rw-r--r--src/libs/utils/filestreamer.h9
-rw-r--r--src/libs/utils/filestreamermanager.cpp6
-rw-r--r--src/libs/utils/process.cpp2
-rw-r--r--src/libs/utils/unarchiver.cpp12
-rw-r--r--src/libs/utils/unarchiver.h2
-rw-r--r--src/plugins/clangtools/clangtool.cpp10
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildstep.cpp6
-rw-r--r--src/plugins/coreplugin/locator/ilocatorfilter.cpp2
-rw-r--r--src/plugins/coreplugin/locator/javascriptfilter.cpp6
-rw-r--r--src/plugins/ios/iosdeploystep.cpp8
-rw-r--r--src/plugins/languageclient/clientrequest.cpp3
-rw-r--r--src/plugins/languageclient/currentdocumentsymbolsrequest.cpp7
-rw-r--r--src/plugins/languageclient/currentdocumentsymbolsrequest.h2
-rw-r--r--src/plugins/projectexplorer/buildmanager.cpp4
-rw-r--r--src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h10
-rw-r--r--src/plugins/projectexplorer/devicesupport/filetransfer.cpp7
-rw-r--r--src/plugins/projectexplorer/devicesupport/idevice.cpp9
-rw-r--r--src/plugins/projectexplorer/devicesupport/idevice.h2
-rw-r--r--src/plugins/qbsprojectmanager/qbsrequest.cpp13
-rw-r--r--src/plugins/qbsprojectmanager/qbsrequest.h2
-rw-r--r--src/plugins/qmldesigner/utils/fileextractor.cpp6
-rw-r--r--src/plugins/studiowelcome/examplecheckout.cpp6
-rw-r--r--src/plugins/valgrind/memchecktool.cpp4
-rw-r--r--src/plugins/valgrind/valgrindprocess.cpp8
-rw-r--r--src/plugins/valgrind/valgrindprocess.h2
-rw-r--r--src/plugins/valgrind/xmlprotocol/parser.cpp7
-rw-r--r--src/plugins/valgrind/xmlprotocol/parser.h2
-rw-r--r--tests/auto/solutions/tasking/tst_tasking.cpp2
-rw-r--r--tests/auto/valgrind/memcheck/modeldemo.cpp4
39 files changed, 191 insertions, 160 deletions
diff --git a/src/libs/solutions/tasking/barrier.cpp b/src/libs/solutions/tasking/barrier.cpp
index c4daa033b4..e160dbac76 100644
--- a/src/libs/solutions/tasking/barrier.cpp
+++ b/src/libs/solutions/tasking/barrier.cpp
@@ -35,18 +35,18 @@ void Barrier::advance()
return;
++m_current;
if (m_current == m_limit)
- stopWithResult(true);
+ stopWithResult(DoneResult::Success);
}
-void Barrier::stopWithResult(bool success)
+void Barrier::stopWithResult(DoneResult result)
{
// Calling stopWithResult on finished is OK when the same success is passed
- QTC_ASSERT(isRunning() || (m_result && *m_result == success), return);
+ QTC_ASSERT(isRunning() || (m_result && *m_result == result), return);
if (!isRunning()) // no-op
return;
m_current = -1;
- m_result = success;
- emit done(success);
+ m_result = result;
+ emit done(result);
}
} // namespace Tasking
diff --git a/src/libs/solutions/tasking/barrier.h b/src/libs/solutions/tasking/barrier.h
index 3001916fb6..13b6dfa48f 100644
--- a/src/libs/solutions/tasking/barrier.h
+++ b/src/libs/solutions/tasking/barrier.h
@@ -19,17 +19,17 @@ public:
void start();
void advance(); // If limit reached, stops with true
- void stopWithResult(bool success); // Ignores limit
+ void stopWithResult(DoneResult result); // Ignores limit
bool isRunning() const { return m_current >= 0; }
int current() const { return m_current; }
- std::optional<bool> result() const { return m_result; }
+ std::optional<DoneResult> result() const { return m_result; }
signals:
- void done(bool success);
+ void done(DoneResult success);
private:
- std::optional<bool> m_result = {};
+ std::optional<DoneResult> m_result = {};
int m_limit = 1;
int m_current = -1;
};
@@ -80,9 +80,11 @@ GroupItem waitForBarrierTask(const MultiBarrier<Limit> &sharedBarrier)
return SetupResult::StopWithError;
}
Barrier *activeSharedBarrier = activeBarrier->barrier();
- const std::optional<bool> result = activeSharedBarrier->result();
- if (result.has_value())
- return result.value() ? SetupResult::StopWithSuccess : SetupResult::StopWithError;
+ const std::optional<DoneResult> result = activeSharedBarrier->result();
+ if (result.has_value()) {
+ return result.value() == DoneResult::Success ? SetupResult::StopWithSuccess
+ : SetupResult::StopWithError;
+ }
QObject::connect(activeSharedBarrier, &Barrier::done, &barrier, &Barrier::stopWithResult);
return SetupResult::Continue;
});
diff --git a/src/libs/solutions/tasking/concurrentcall.h b/src/libs/solutions/tasking/concurrentcall.h
index 6298b05372..300d0cd610 100644
--- a/src/libs/solutions/tasking/concurrentcall.h
+++ b/src/libs/solutions/tasking/concurrentcall.h
@@ -78,12 +78,12 @@ public:
void start() {
if (!this->task()->m_startHandler) {
- emit this->done(false); // TODO: Add runtime assert
+ emit this->done(DoneResult::Error); // TODO: Add runtime assert
return;
}
m_watcher.reset(new QFutureWatcher<ResultType>);
this->connect(m_watcher.get(), &QFutureWatcherBase::finished, this, [this] {
- emit this->done(!m_watcher->isCanceled());
+ emit this->done(toDoneResult(!m_watcher->isCanceled()));
m_watcher.release()->deleteLater();
});
this->task()->m_future = this->task()->m_startHandler();
diff --git a/src/libs/solutions/tasking/networkquery.cpp b/src/libs/solutions/tasking/networkquery.cpp
index 292d3c7d4a..07d1c00817 100644
--- a/src/libs/solutions/tasking/networkquery.cpp
+++ b/src/libs/solutions/tasking/networkquery.cpp
@@ -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())
diff --git a/src/libs/solutions/tasking/networkquery.h b/src/libs/solutions/tasking/networkquery.h
index 0cac720584..bf08bd1e7b 100644
--- a/src/libs/solutions/tasking/networkquery.h
+++ b/src/libs/solutions/tasking/networkquery.h
@@ -35,7 +35,7 @@ public:
signals:
void started();
- void done(bool success);
+ void done(DoneResult result);
private:
QNetworkRequest m_request;
diff --git a/src/libs/solutions/tasking/qprocesstask.h b/src/libs/solutions/tasking/qprocesstask.h
index 5fa4c19a41..cc0b83698b 100644
--- a/src/libs/solutions/tasking/qprocesstask.h
+++ b/src/libs/solutions/tasking/qprocesstask.h
@@ -50,12 +50,12 @@ private:
const bool success = task()->exitStatus() == QProcess::NormalExit
&& task()->error() == QProcess::UnknownError
&& task()->exitCode() == 0;
- emit done(success);
+ emit done(toDoneResult(success));
});
connect(task(), &QProcess::errorOccurred, this, [this](QProcess::ProcessError error) {
if (error != QProcess::FailedToStart)
return;
- emit done(false);
+ emit done(DoneResult::Error);
});
task()->start();
}
diff --git a/src/libs/solutions/tasking/tasktree.cpp b/src/libs/solutions/tasking/tasktree.cpp
index d140154859..6058f3bd1c 100644
--- a/src/libs/solutions/tasking/tasktree.cpp
+++ b/src/libs/solutions/tasking/tasktree.cpp
@@ -836,6 +836,11 @@ const GroupItem stopOnSuccessOrError = workflowPolicy(WorkflowPolicy::StopOnSucc
const GroupItem finishAllAndSuccess = workflowPolicy(WorkflowPolicy::FinishAllAndSuccess);
const GroupItem finishAllAndError = workflowPolicy(WorkflowPolicy::FinishAllAndError);
+DoneResult toDoneResult(bool success)
+{
+ return success ? DoneResult::Success : DoneResult::Error;
+}
+
static SetupResult toSetupResult(bool success)
{
return success ? SetupResult::StopWithSuccess : SetupResult::StopWithError;
@@ -846,6 +851,11 @@ static DoneResult toDoneResult(DoneWith doneWith)
return doneWith == DoneWith::Success ? DoneResult::Success : DoneResult::Error;
}
+static DoneWith toDoneWith(DoneResult result)
+{
+ return result == DoneResult::Success ? DoneWith::Success : DoneWith::Error;
+}
+
class StorageThreadData
{
Q_DISABLE_COPY_MOVE(StorageThreadData)
@@ -1548,8 +1558,8 @@ SetupResult TaskTreePrivate::start(TaskRuntimeNode *node)
const std::shared_ptr<SetupResult> unwindAction
= std::make_shared<SetupResult>(SetupResult::Continue);
QObject::connect(node->m_task.get(), &TaskInterface::done,
- q, [this, node, unwindAction](bool success) {
- const bool result = invokeDoneHandler(node, success ? DoneWith::Success : DoneWith::Error);
+ q, [this, node, unwindAction](DoneResult doneResult) {
+ const bool result = invokeDoneHandler(node, toDoneWith(doneResult));
QObject::disconnect(node->m_task.get(), &TaskInterface::done, q, nullptr);
node->m_task.release()->deleteLater();
TaskRuntimeContainer *parentContainer = node->m_parentContainer;
@@ -2650,7 +2660,7 @@ void TaskTree::setupStorageHandler(const TreeStorageBase &storage,
TaskTreeTaskAdapter::TaskTreeTaskAdapter()
{
connect(task(), &TaskTree::done, this,
- [this](DoneWith result) { emit done(result == DoneWith::Success); });
+ [this](DoneWith result) { emit done(toDoneResult(result)); });
}
void TaskTreeTaskAdapter::start()
@@ -2743,7 +2753,10 @@ TimeoutTaskAdapter::~TimeoutTaskAdapter()
void TimeoutTaskAdapter::start()
{
- m_timerId = scheduleTimeout(*task(), this, [this] { m_timerId = {}; emit done(true); });
+ m_timerId = scheduleTimeout(*task(), this, [this] {
+ m_timerId = {};
+ emit done(DoneResult::Success);
+ });
}
} // namespace Tasking
diff --git a/src/libs/solutions/tasking/tasktree.h b/src/libs/solutions/tasking/tasktree.h
index 0be2aa097f..5fa2d1e89d 100644
--- a/src/libs/solutions/tasking/tasktree.h
+++ b/src/libs/solutions/tasking/tasktree.h
@@ -19,6 +19,63 @@ namespace Tasking {
Q_NAMESPACE_EXPORT(TASKING_EXPORT)
+// WorkflowPolicy:
+// 1. When all children finished with success -> report success, otherwise:
+// a) Report error on first error and stop executing other children (including their subtree).
+// b) On first error - continue executing all children and report error afterwards.
+// 2. When all children finished with error -> report error, otherwise:
+// a) Report success on first success and stop executing other children (including their subtree).
+// b) On first success - continue executing all children and report success afterwards.
+// 3. Stops on first finished child. In sequential mode it will never run other children then the first one.
+// Useful only in parallel mode.
+// 4. Always run all children, let them finish, ignore their results and report success afterwards.
+// 5. Always run all children, let them finish, ignore their results and report error afterwards.
+
+enum class WorkflowPolicy
+{
+ StopOnError, // 1a - Reports error on first child error, otherwise success (if all children were success).
+ ContinueOnError, // 1b - The same, but children execution continues. Reports success when no children.
+ StopOnSuccess, // 2a - Reports success on first child success, otherwise error (if all children were error).
+ ContinueOnSuccess, // 2b - The same, but children execution continues. Reports error when no children.
+ StopOnSuccessOrError, // 3 - Stops on first finished child and report its result.
+ FinishAllAndSuccess, // 4 - Reports success after all children finished.
+ FinishAllAndError // 5 - Reports error after all children finished.
+};
+Q_ENUM_NS(WorkflowPolicy);
+
+enum class SetupResult
+{
+ Continue,
+ StopWithSuccess,
+ StopWithError
+};
+Q_ENUM_NS(SetupResult);
+
+enum class DoneResult
+{
+ Success,
+ Error
+};
+Q_ENUM_NS(DoneResult);
+
+enum class DoneWith
+{
+ Success,
+ Error,
+ Cancel
+};
+Q_ENUM_NS(DoneWith);
+
+enum class CallDoneIf
+{
+ SuccessOrError,
+ Success,
+ Error
+};
+Q_ENUM_NS(CallDoneIf);
+
+TASKING_EXPORT DoneResult toDoneResult(bool success);
+
class StorageData;
class TaskTreePrivate;
@@ -27,7 +84,7 @@ class TASKING_EXPORT TaskInterface : public QObject
Q_OBJECT
signals:
- void done(bool success);
+ void done(DoneResult result);
private:
template <typename Task, typename Deleter> friend class TaskAdapter;
@@ -88,61 +145,6 @@ private:
}
};
-// WorkflowPolicy:
-// 1. When all children finished with success -> report success, otherwise:
-// a) Report error on first error and stop executing other children (including their subtree).
-// b) On first error - continue executing all children and report error afterwards.
-// 2. When all children finished with error -> report error, otherwise:
-// a) Report success on first success and stop executing other children (including their subtree).
-// b) On first success - continue executing all children and report success afterwards.
-// 3. Stops on first finished child. In sequential mode it will never run other children then the first one.
-// Useful only in parallel mode.
-// 4. Always run all children, let them finish, ignore their results and report success afterwards.
-// 5. Always run all children, let them finish, ignore their results and report error afterwards.
-
-enum class WorkflowPolicy
-{
- StopOnError, // 1a - Reports error on first child error, otherwise success (if all children were success).
- ContinueOnError, // 1b - The same, but children execution continues. Reports success when no children.
- StopOnSuccess, // 2a - Reports success on first child success, otherwise error (if all children were error).
- ContinueOnSuccess, // 2b - The same, but children execution continues. Reports error when no children.
- StopOnSuccessOrError, // 3 - Stops on first finished child and report its result.
- FinishAllAndSuccess, // 4 - Reports success after all children finished.
- FinishAllAndError // 5 - Reports error after all children finished.
-};
-Q_ENUM_NS(WorkflowPolicy);
-
-enum class SetupResult
-{
- Continue,
- StopWithSuccess,
- StopWithError
-};
-Q_ENUM_NS(SetupResult);
-
-enum class DoneResult
-{
- Success,
- Error
-};
-Q_ENUM_NS(DoneResult);
-
-enum class DoneWith
-{
- Success,
- Error,
- Cancel
-};
-Q_ENUM_NS(DoneWith);
-
-enum class CallDoneIf
-{
- SuccessOrError,
- Success,
- Error
-};
-Q_ENUM_NS(CallDoneIf);
-
class TASKING_EXPORT GroupItem
{
public:
diff --git a/src/libs/utils/async.h b/src/libs/utils/async.h
index 64ade0a9e3..d10f4e2fed 100644
--- a/src/libs/utils/async.h
+++ b/src/libs/utils/async.h
@@ -204,7 +204,7 @@ class AsyncTaskAdapter : public Tasking::TaskAdapter<Async<ResultType>>
public:
AsyncTaskAdapter() {
this->connect(this->task(), &AsyncBase::done, this, [this] {
- emit this->done(!this->task()->isCanceled());
+ emit this->done(Tasking::toDoneResult(!this->task()->isCanceled()));
});
}
void start() final { this->task()->start(); }
diff --git a/src/libs/utils/filestreamer.cpp b/src/libs/utils/filestreamer.cpp
index d4d34c477f..0e834e0acf 100644
--- a/src/libs/utils/filestreamer.cpp
+++ b/src/libs/utils/filestreamer.cpp
@@ -34,13 +34,13 @@ public:
m_taskTree.reset(new TaskTree({task}));
connect(m_taskTree.get(), &TaskTree::done, this, [this](DoneWith result) {
m_taskTree.release()->deleteLater();
- emit done(result == DoneWith::Success);
+ emit done(toDoneResult(result == DoneWith::Success));
});
m_taskTree->start();
}
signals:
- void done(bool success);
+ void done(DoneResult result);
protected:
FilePath m_filePath;
@@ -381,7 +381,7 @@ public:
FilePath m_destination;
QByteArray m_readBuffer;
QByteArray m_writeBuffer;
- StreamResult m_streamResult = StreamResult::FinishedWithError;
+ DoneResult m_streamResult = DoneResult::Error;
std::unique_ptr<TaskTree> m_taskTree;
GroupItem task() {
@@ -454,7 +454,7 @@ void FileStreamer::setWriteData(const QByteArray &writeData)
d->m_writeBuffer = writeData;
}
-StreamResult FileStreamer::result() const
+DoneResult FileStreamer::result() const
{
return d->m_streamResult;
}
@@ -465,8 +465,7 @@ void FileStreamer::start()
QTC_ASSERT(!d->m_taskTree, return);
d->m_taskTree.reset(new TaskTree({d->task()}));
connect(d->m_taskTree.get(), &TaskTree::done, this, [this](DoneWith result) {
- d->m_streamResult = result == DoneWith::Success ? StreamResult::FinishedWithSuccess
- : StreamResult::FinishedWithError;
+ d->m_streamResult = toDoneResult(result == DoneWith::Success);
d->m_taskTree.release()->deleteLater();
emit done();
});
diff --git a/src/libs/utils/filestreamer.h b/src/libs/utils/filestreamer.h
index 828f27be8e..8f569ff436 100644
--- a/src/libs/utils/filestreamer.h
+++ b/src/libs/utils/filestreamer.h
@@ -19,8 +19,6 @@ namespace Utils {
enum class StreamMode { Reader, Writer, Transfer };
-enum class StreamResult { FinishedWithSuccess, FinishedWithError };
-
class QTCREATOR_UTILS_EXPORT FileStreamer final : public QObject
{
Q_OBJECT
@@ -38,7 +36,7 @@ public:
// Only for Writer mode
void setWriteData(const QByteArray &writeData);
- StreamResult result() const;
+ Tasking::DoneResult result() const;
void start();
void stop();
@@ -53,8 +51,9 @@ private:
class FileStreamerTaskAdapter : public Tasking::TaskAdapter<FileStreamer>
{
public:
- FileStreamerTaskAdapter() { connect(task(), &FileStreamer::done, this,
- [this] { emit done(task()->result() == StreamResult::FinishedWithSuccess); }); }
+ FileStreamerTaskAdapter() {
+ connect(task(), &FileStreamer::done, this, [this] { emit done(task()->result()); });
+ }
void start() override { task()->start(); }
};
diff --git a/src/libs/utils/filestreamermanager.cpp b/src/libs/utils/filestreamermanager.cpp
index 33df7b264e..9cdfb15c03 100644
--- a/src/libs/utils/filestreamermanager.cpp
+++ b/src/libs/utils/filestreamermanager.cpp
@@ -129,7 +129,7 @@ FileStreamHandle FileStreamerManager::copy(const FilePath &source, const FilePat
return execute(onSetup, {}, context);
const auto onDone = [=](FileStreamer *streamer) {
- if (streamer->result() == StreamResult::FinishedWithSuccess)
+ if (streamer->result() == Tasking::DoneResult::Success)
cont({});
else
cont(make_unexpected(Tr::tr("Failed copying file.")));
@@ -153,7 +153,7 @@ FileStreamHandle FileStreamerManager::read(const FilePath &source, QObject *cont
return execute(onSetup, {}, context);
const auto onDone = [=](FileStreamer *streamer) {
- if (streamer->result() == StreamResult::FinishedWithSuccess)
+ if (streamer->result() == Tasking::DoneResult::Success)
cont(streamer->readData());
else
cont(make_unexpected(Tr::tr("Failed reading file.")));
@@ -179,7 +179,7 @@ FileStreamHandle FileStreamerManager::write(const FilePath &destination, const Q
return execute(onSetup, {}, context);
const auto onDone = [=](FileStreamer *streamer) {
- if (streamer->result() == StreamResult::FinishedWithSuccess)
+ if (streamer->result() == Tasking::DoneResult::Success)
cont(0); // TODO: return write count?
else
cont(make_unexpected(Tr::tr("Failed writing file.")));
diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp
index 192b3bc880..29f4a1f852 100644
--- a/src/libs/utils/process.cpp
+++ b/src/libs/utils/process.cpp
@@ -2160,7 +2160,7 @@ void ProcessPrivate::storeEventLoopDebugInfo(const QVariant &value)
ProcessTaskAdapter::ProcessTaskAdapter()
{
connect(task(), &Process::done, this, [this] {
- emit done(task()->result() == ProcessResult::FinishedWithSuccess);
+ emit done(Tasking::toDoneResult(task()->result() == ProcessResult::FinishedWithSuccess));
});
}
diff --git a/src/libs/utils/unarchiver.cpp b/src/libs/utils/unarchiver.cpp
index 9435bc77a5..8436565425 100644
--- a/src/libs/utils/unarchiver.cpp
+++ b/src/libs/utils/unarchiver.cpp
@@ -10,6 +10,8 @@
#include <QSettings>
+using namespace Tasking;
+
namespace Utils {
namespace {
@@ -128,16 +130,16 @@ static CommandLine unarchiveCommand(const CommandLine &commandTemplate, const Fi
void Unarchiver::start()
{
- QTC_ASSERT(!m_process, emit done(false); return);
+ QTC_ASSERT(!m_process, emit done(DoneResult::Error); return);
if (!m_sourceAndCommand) {
emit outputReceived(Tr::tr("No source file set."));
- emit done(false);
+ emit done(DoneResult::Error);
return;
}
if (m_destDir.isEmpty()) {
emit outputReceived(Tr::tr("No destination directory set."));
- emit done(false);
+ emit done(DoneResult::Error);
return;
}
@@ -154,7 +156,7 @@ void Unarchiver::start()
const bool success = m_process->result() == ProcessResult::FinishedWithSuccess;
if (!success)
emit outputReceived(Tr::tr("Command failed."));
- emit done(success);
+ emit done(toDoneResult(success));
});
emit outputReceived(Tr::tr("Running %1\nin \"%2\".\n\n", "Running <cmd> in <workingdirectory>")
@@ -167,7 +169,7 @@ void Unarchiver::start()
UnarchiverTaskAdapter::UnarchiverTaskAdapter()
{
- connect(task(), &Unarchiver::done, this, &Tasking::TaskInterface::done);
+ connect(task(), &Unarchiver::done, this, &TaskInterface::done);
}
void UnarchiverTaskAdapter::start()
diff --git a/src/libs/utils/unarchiver.h b/src/libs/utils/unarchiver.h
index 3e2b2f8938..b255cd4990 100644
--- a/src/libs/utils/unarchiver.h
+++ b/src/libs/utils/unarchiver.h
@@ -37,7 +37,7 @@ public:
signals:
void outputReceived(const QString &output);
- void done(bool success);
+ void done(Tasking::DoneResult result);
private:
std::optional<SourceAndCommand> m_sourceAndCommand;
diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp
index 4033785e79..61b30cfa5f 100644
--- a/src/plugins/clangtools/clangtool.cpp
+++ b/src/plugins/clangtools/clangtool.cpp
@@ -75,11 +75,13 @@ class ProjectBuilderTaskAdapter : public TaskAdapter<QPointer<RunControl>>
public:
void start() final {
connect(BuildManager::instance(), &BuildManager::buildQueueFinished,
- this, &TaskInterface::done);
+ this, [this](bool success) {
+ emit done(toDoneResult(success));
+ });
RunControl *runControl = *task();
- QTC_ASSERT(runControl, emit done(false); return);
+ QTC_ASSERT(runControl, emit done(DoneResult::Error); return);
Target *target = runControl->target();
- QTC_ASSERT(target, emit done(false); return);
+ QTC_ASSERT(target, emit done(DoneResult::Error); return);
if (!BuildManager::isBuilding(target)) {
BuildManager::buildProjectWithDependencies(target->project(), ConfigSelection::Active,
runControl);
@@ -822,7 +824,7 @@ Group ClangTool::runRecipe(const RunSettings &runSettings,
};
topTasks.append(Group {
- Tasking::Storage(storage),
+ Storage(storage),
TaskTreeTask(onTreeSetup, onTreeDone, CallDoneIf::Success)
});
return {topTasks};
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
index b2e13b84b5..e1330280f7 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
@@ -68,10 +68,12 @@ public:
void start() final {
Target *target = *task();
if (!target) {
- emit done(false);
+ emit done(DoneResult::Error);
return;
}
- connect(target, &Target::parsingFinished, this, &TaskInterface::done);
+ connect(target, &Target::parsingFinished, this, [this](bool success) {
+ emit done(toDoneResult(success));
+ });
}
};
diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp
index f66dc0383f..94cc24831c 100644
--- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp
+++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp
@@ -322,7 +322,7 @@ class ResultsCollectorTaskAdapter : public TaskAdapter<ResultsCollector>
{
public:
ResultsCollectorTaskAdapter() {
- connect(task(), &ResultsCollector::done, this, [this] { emit done(true); });
+ connect(task(), &ResultsCollector::done, this, [this] { emit done(DoneResult::Success); });
}
void start() final { task()->start(); }
};
diff --git a/src/plugins/coreplugin/locator/javascriptfilter.cpp b/src/plugins/coreplugin/locator/javascriptfilter.cpp
index 73c723e988..f1b8af35b9 100644
--- a/src/plugins/coreplugin/locator/javascriptfilter.cpp
+++ b/src/plugins/coreplugin/locator/javascriptfilter.cpp
@@ -305,7 +305,7 @@ public:
m_timer.reset();
m_output = output;
m_id = {};
- emit done(output.m_result == JavaScriptResult::FinishedWithSuccess);
+ emit done(toDoneResult(output.m_result == JavaScriptResult::FinishedWithSuccess));
};
m_id = m_engine->addRequest(input);
if (m_timeout > 0ms) {
@@ -318,7 +318,7 @@ public:
m_timer.release()->deleteLater();
m_id = {};
m_output = {Tr::tr("Engine aborted after timeout."), JavaScriptResult::Canceled};
- emit done(false);
+ emit done(DoneResult::Error);
});
m_timer->start();
}
@@ -328,7 +328,7 @@ public:
JavaScriptOutput output() const { return m_output; }
signals:
- void done(bool success);
+ void done(DoneResult result);
private:
QPointer<JavaScriptEngine> m_engine;
diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp
index 3f80d9d931..02f75d2767 100644
--- a/src/plugins/ios/iosdeploystep.cpp
+++ b/src/plugins/ios/iosdeploystep.cpp
@@ -41,7 +41,7 @@ public:
void setExpectSuccess(bool success) { m_expectSuccess = success; }
void start()
{
- QTC_ASSERT(m_deviceType, emit done(false); return);
+ QTC_ASSERT(m_deviceType, emit done(DoneResult::Error); return);
QTC_ASSERT(!m_toolHandler, return);
m_toolHandler.reset(new IosToolHandler(*m_deviceType));
@@ -65,19 +65,19 @@ public:
TaskHub::addTask(DeploymentTask(Task::Error, Tr::tr("Deployment failed. "
"The settings in the Devices window of Xcode might be incorrect.")));
}
- emit done(status == IosToolHandler::Success);
+ emit done(toDoneResult(status == IosToolHandler::Success));
});
connect(m_toolHandler.get(), &IosToolHandler::finished, this, [this] {
disconnect(m_toolHandler.get(), nullptr, this, nullptr);
m_toolHandler.release()->deleteLater();
TaskHub::addTask(DeploymentTask(Task::Error, Tr::tr("Deployment failed.")));
- emit done(false);
+ emit done(DoneResult::Error);
});
m_toolHandler->requestTransferApp(m_bundlePath, m_deviceType->identifier);
}
signals:
- void done(bool success);
+ void done(DoneResult result);
void progressValueChanged(int progress, const QString &info); // progress in %
void errorMessage(const QString &message);
diff --git a/src/plugins/languageclient/clientrequest.cpp b/src/plugins/languageclient/clientrequest.cpp
index 630a1b0194..4e221f1b9d 100644
--- a/src/plugins/languageclient/clientrequest.cpp
+++ b/src/plugins/languageclient/clientrequest.cpp
@@ -4,13 +4,14 @@
#include "clientrequest.h"
using namespace LanguageServerProtocol;
+using namespace Tasking;
namespace LanguageClient {
ClientWorkspaceSymbolRequestTaskAdapter::ClientWorkspaceSymbolRequestTaskAdapter()
{
task()->setResponseCallback([this](const WorkspaceSymbolRequest::Response &response){
- emit done(response.result().has_value());
+ emit done(toDoneResult(response.result().has_value()));
});
}
diff --git a/src/plugins/languageclient/currentdocumentsymbolsrequest.cpp b/src/plugins/languageclient/currentdocumentsymbolsrequest.cpp
index 2d272a7216..15506e0e99 100644
--- a/src/plugins/languageclient/currentdocumentsymbolsrequest.cpp
+++ b/src/plugins/languageclient/currentdocumentsymbolsrequest.cpp
@@ -10,6 +10,7 @@
using namespace Core;
using namespace LanguageServerProtocol;
+using namespace Tasking;
using namespace TextEditor;
using namespace Utils;
@@ -24,7 +25,7 @@ void CurrentDocumentSymbolsRequest::start()
TextDocument *document = TextDocument::currentTextDocument();
Client *client = LanguageClientManager::clientForDocument(document);
if (!client) {
- emit done(false);
+ emit done(DoneResult::Error);
return;
}
@@ -34,7 +35,7 @@ void CurrentDocumentSymbolsRequest::start()
const auto reportFailure = [this] {
clearConnections();
- emit done(false);
+ emit done(DoneResult::Error);
};
const auto updateSymbols = [this, currentUri, pathMapper](const DocumentUri &uri,
@@ -46,7 +47,7 @@ void CurrentDocumentSymbolsRequest::start()
const FilePath filePath = pathMapper ? currentUri.toFilePath(pathMapper) : FilePath();
m_currentDocumentSymbolsData = {filePath, pathMapper, symbols};
clearConnections();
- emit done(true);
+ emit done(DoneResult::Success);
};
m_connections.append(connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
diff --git a/src/plugins/languageclient/currentdocumentsymbolsrequest.h b/src/plugins/languageclient/currentdocumentsymbolsrequest.h
index ef124154df..3ea7ee5f15 100644
--- a/src/plugins/languageclient/currentdocumentsymbolsrequest.h
+++ b/src/plugins/languageclient/currentdocumentsymbolsrequest.h
@@ -30,7 +30,7 @@ public:
CurrentDocumentSymbolsData currentDocumentSymbolsData() const { return m_currentDocumentSymbolsData; }
signals:
- void done(bool success);
+ void done(Tasking::DoneResult result);
private:
void clearConnections();
diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp
index 46d90d14e8..ef2307309b 100644
--- a/src/plugins/projectexplorer/buildmanager.cpp
+++ b/src/plugins/projectexplorer/buildmanager.cpp
@@ -67,14 +67,14 @@ private:
this, [this, buildSystem](bool success) {
disconnect(buildSystem, &BuildSystem::parsingFinished, this, nullptr);
if (!success) {
- emit done(false);
+ emit done(DoneResult::Error);
return;
}
checkParsing();
});
return;
}
- emit done(true);
+ emit done(DoneResult::Success);
}
};
diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h
index ee6b276006..dead5f222a 100644
--- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h
+++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h
@@ -11,6 +11,8 @@
#include <utils/portlist.h>
+using namespace Tasking;
+
namespace ProjectExplorer {
namespace Internal {
@@ -45,12 +47,12 @@ private:
};
class PROJECTEXPLORER_EXPORT DeviceUsedPortsGathererTaskAdapter
- : public Tasking::TaskAdapter<DeviceUsedPortsGatherer>
+ : public TaskAdapter<DeviceUsedPortsGatherer>
{
public:
DeviceUsedPortsGathererTaskAdapter() {
- connect(task(), &DeviceUsedPortsGatherer::portListReady, this, [this] { emit done(true); });
- connect(task(), &DeviceUsedPortsGatherer::error, this, [this] { emit done(false); });
+ connect(task(), &DeviceUsedPortsGatherer::portListReady, this, [this] { emit done(DoneResult::Success); });
+ connect(task(), &DeviceUsedPortsGatherer::error, this, [this] { emit done(DoneResult::Error); });
}
void start() final { task()->start(); }
};
@@ -87,6 +89,6 @@ private:
QVector<Internal::SubChannelProvider *> m_channelProviders;
};
-using DeviceUsedPortsGathererTask = Tasking::CustomTask<DeviceUsedPortsGathererTaskAdapter>;
+using DeviceUsedPortsGathererTask = CustomTask<DeviceUsedPortsGathererTaskAdapter>;
} // namespace ProjectExplorer
diff --git a/src/plugins/projectexplorer/devicesupport/filetransfer.cpp b/src/plugins/projectexplorer/devicesupport/filetransfer.cpp
index 0581579767..b31a8f4428 100644
--- a/src/plugins/projectexplorer/devicesupport/filetransfer.cpp
+++ b/src/plugins/projectexplorer/devicesupport/filetransfer.cpp
@@ -196,9 +196,10 @@ QString FileTransfer::transferMethodName(FileTransferMethod method)
FileTransferTaskAdapter::FileTransferTaskAdapter()
{
connect(task(), &FileTransfer::done, this, [this](const ProcessResultData &result) {
- emit done(result.m_exitStatus == QProcess::NormalExit
- && result.m_error == QProcess::UnknownError
- && result.m_exitCode == 0);
+ const bool success = result.m_exitStatus == QProcess::NormalExit
+ && result.m_error == QProcess::UnknownError
+ && result.m_exitCode == 0;
+ emit done(Tasking::toDoneResult(success));
});
}
diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp
index 489e6b337e..5969755446 100644
--- a/src/plugins/projectexplorer/devicesupport/idevice.cpp
+++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp
@@ -5,7 +5,6 @@
#include "devicemanager.h"
#include "idevicefactory.h"
-#include "processlist.h"
#include "sshparameters.h"
#include "../kit.h"
@@ -710,6 +709,8 @@ void DeviceProcessSignalOperation::setDebuggerCommand(const FilePath &cmd)
DeviceProcessSignalOperation::DeviceProcessSignalOperation() = default;
+using namespace Tasking;
+
void DeviceProcessKiller::start()
{
m_signalOperation.reset();
@@ -718,7 +719,7 @@ void DeviceProcessKiller::start()
const IDevice::ConstPtr device = DeviceManager::deviceForPath(m_processPath);
if (!device) {
m_errorString = Tr::tr("No device for given path: \"%1\".").arg(m_processPath.toUserOutput());
- emit done(false);
+ emit done(DoneResult::Error);
return;
}
@@ -726,14 +727,14 @@ void DeviceProcessKiller::start()
if (!m_signalOperation) {
m_errorString = Tr::tr("Device for path \"%1\" does not support killing processes.")
.arg(m_processPath.toUserOutput());
- emit done(false);
+ emit done(DoneResult::Error);
return;
}
connect(m_signalOperation.get(), &DeviceProcessSignalOperation::finished,
this, [this](const QString &errorMessage) {
m_errorString = errorMessage;
- emit done(m_errorString.isEmpty());
+ emit done(toDoneResult(m_errorString.isEmpty()));
});
m_signalOperation->killProcess(m_processPath.path());
diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h
index a6f9d860b8..4642697c76 100644
--- a/src/plugins/projectexplorer/devicesupport/idevice.h
+++ b/src/plugins/projectexplorer/devicesupport/idevice.h
@@ -279,7 +279,7 @@ public:
QString errorString() const { return m_errorString; }
signals:
- void done(bool success);
+ void done(Tasking::DoneResult result);
private:
Utils::FilePath m_processPath;
diff --git a/src/plugins/qbsprojectmanager/qbsrequest.cpp b/src/plugins/qbsprojectmanager/qbsrequest.cpp
index 1355922b44..e6ac1c2fb8 100644
--- a/src/plugins/qbsprojectmanager/qbsrequest.cpp
+++ b/src/plugins/qbsprojectmanager/qbsrequest.cpp
@@ -13,6 +13,7 @@
#include <utils/qtcassert.h>
using namespace ProjectExplorer;
+using namespace Tasking;
using namespace Utils;
namespace QbsProjectManager::Internal {
@@ -40,7 +41,7 @@ public:
void cancel();
signals:
- void done(bool success);
+ void done(DoneResult result);
void progressChanged(int progress, const QString &info); // progress in %
void outputAdded(const QString &output, ProjectExplorer::BuildStep::OutputFormat format);
void taskAdded(const ProjectExplorer::Task &task);
@@ -114,7 +115,7 @@ void QbsRequestObject::start()
if (m_parseData) {
connect(m_parseData->target(), &Target::parsingFinished, this, [this](bool success) {
disconnect(m_parseData->target(), &Target::parsingFinished, this, nullptr);
- emit done(success);
+ emit done(toDoneResult(success));
});
QMetaObject::invokeMethod(m_parseData.get(), &QbsBuildSystem::startParsing,
Qt::QueuedConnection);
@@ -127,7 +128,7 @@ void QbsRequestObject::start()
emit outputAdded(item.description, BuildStep::OutputFormat::Stdout);
emit taskAdded(CompileTask(Task::Error, item.description, item.filePath, item.line));
}
- emit done(error.items.isEmpty());
+ emit done(toDoneResult(error.items.isEmpty()));
};
connect(m_session, &QbsSession::projectBuilt, this, handleDone);
connect(m_session, &QbsSession::projectCleaned, this, handleDone);
@@ -188,7 +189,7 @@ QbsRequest::~QbsRequest()
void QbsRequest::start()
{
QTC_ASSERT(!m_requestObject, return);
- QTC_ASSERT(m_parseData || (m_session && m_requestData), emit done(false); return);
+ QTC_ASSERT(m_parseData || (m_session && m_requestData), emit done(DoneResult::Error); return);
m_requestObject = new QbsRequestObject;
m_requestObject->setSession(m_session);
@@ -199,10 +200,10 @@ void QbsRequest::start()
m_requestObject->setParseData(m_parseData);
}
- connect(m_requestObject, &QbsRequestObject::done, this, [this](bool success) {
+ connect(m_requestObject, &QbsRequestObject::done, this, [this](DoneResult result) {
m_requestObject->deleteLater();
m_requestObject = nullptr;
- emit done(success);
+ emit done(result);
});
connect(m_requestObject, &QbsRequestObject::progressChanged,
this, &QbsRequest::progressChanged);
diff --git a/src/plugins/qbsprojectmanager/qbsrequest.h b/src/plugins/qbsprojectmanager/qbsrequest.h
index e86909504b..bd3eb6db43 100644
--- a/src/plugins/qbsprojectmanager/qbsrequest.h
+++ b/src/plugins/qbsprojectmanager/qbsrequest.h
@@ -28,7 +28,7 @@ public:
void start();
signals:
- void done(bool success);
+ void done(Tasking::DoneResult result);
void progressChanged(int progress, const QString &info); // progress in %
void outputAdded(const QString &output, ProjectExplorer::BuildStep::OutputFormat format);
void taskAdded(const ProjectExplorer::Task &task);
diff --git a/src/plugins/qmldesigner/utils/fileextractor.cpp b/src/plugins/qmldesigner/utils/fileextractor.cpp
index 40381c5a27..67dc68aca9 100644
--- a/src/plugins/qmldesigner/utils/fileextractor.cpp
+++ b/src/plugins/qmldesigner/utils/fileextractor.cpp
@@ -243,9 +243,9 @@ void FileExtractor::extract()
emit detailedTextChanged();
});
- QObject::connect(m_unarchiver.get(), &Unarchiver::done, this, [this](bool success) {
+ QObject::connect(m_unarchiver.get(), &Unarchiver::done, this, [this](Tasking::DoneResult result) {
m_unarchiver.release()->deleteLater();
- m_finished = success;
+ m_finished = result == Tasking::DoneResult::Success;
m_timer.stop();
m_progress = 100;
@@ -253,7 +253,7 @@ void FileExtractor::extract()
emit targetFolderExistsChanged();
emit finishedChanged();
- QTC_CHECK(success);
+ QTC_CHECK(m_finished);
});
m_unarchiver->start();
}
diff --git a/src/plugins/studiowelcome/examplecheckout.cpp b/src/plugins/studiowelcome/examplecheckout.cpp
index 7b13c59fa8..d0e3082491 100644
--- a/src/plugins/studiowelcome/examplecheckout.cpp
+++ b/src/plugins/studiowelcome/examplecheckout.cpp
@@ -37,6 +37,7 @@
#include <algorithm>
+using namespace Tasking;
using namespace Utils;
void ExampleCheckout::registerTypes()
@@ -124,8 +125,9 @@ DataModelDownloader::DataModelDownloader(QObject * /* parent */)
auto unarchiver = new Unarchiver;
unarchiver->setSourceAndCommand(*sourceAndCommand);
unarchiver->setDestDir(tempFilePath());
- QObject::connect(unarchiver, &Unarchiver::done, this, [this, unarchiver](bool success) {
- QTC_CHECK(success);
+ QObject::connect(unarchiver, &Unarchiver::done, this,
+ [this, unarchiver](DoneResult result) {
+ QTC_CHECK(result == DoneResult::Success);
unarchiver->deleteLater();
emit finished();
});
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index 1cbd522571..5a23bac90e 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -1051,8 +1051,8 @@ void MemcheckToolPrivate::loadXmlLogFile(const QString &filePath)
m_logParser.reset(new Parser);
connect(m_logParser.get(), &Parser::error, this, &MemcheckToolPrivate::parserError);
- connect(m_logParser.get(), &Parser::done, this, [this](bool success, const QString &err) {
- if (!success)
+ connect(m_logParser.get(), &Parser::done, this, [this](DoneResult result, const QString &err) {
+ if (result == DoneResult::Error)
internalParserError(err);
loadingExternalXmlLogFileFinished();
m_logParser.release()->deleteLater();
diff --git a/src/plugins/valgrind/valgrindprocess.cpp b/src/plugins/valgrind/valgrindprocess.cpp
index e4178f8439..9862d40799 100644
--- a/src/plugins/valgrind/valgrindprocess.cpp
+++ b/src/plugins/valgrind/valgrindprocess.cpp
@@ -93,7 +93,7 @@ public:
const bool success = process->result() == ProcessResult::FinishedWithSuccess;
if (!success)
emit q->processErrorReceived(process->errorString(), process->error());
- emit q->done(success);
+ emit q->done(toDoneResult(success));
});
connect(process, &Process::readyReadStandardOutput, this, [this, process] {
emit q->appendMessage(process->readAllStandardOutput(), StdOutFormat);
@@ -215,7 +215,7 @@ bool ValgrindProcessPrivate::run()
m_taskTree->setRecipe(runRecipe());
connect(m_taskTree.get(), &TaskTree::done, this, [this](DoneWith result) {
m_taskTree.release()->deleteLater();
- emit q->done(result == DoneWith::Success);
+ emit q->done(toDoneResult(result == DoneWith::Success));
});
m_taskTree->start();
return bool(m_taskTree);
@@ -268,8 +268,8 @@ bool ValgrindProcess::runBlocking()
bool ok = false;
QEventLoop loop;
- const auto finalize = [&loop, &ok](bool success) {
- ok = success;
+ const auto finalize = [&loop, &ok](DoneResult result) {
+ ok = result == DoneResult::Success;
// Refer to the QObject::deleteLater() docs.
QMetaObject::invokeMethod(&loop, [&loop] { loop.quit(); }, Qt::QueuedConnection);
};
diff --git a/src/plugins/valgrind/valgrindprocess.h b/src/plugins/valgrind/valgrindprocess.h
index 065d4ad47a..7a4e722c0d 100644
--- a/src/plugins/valgrind/valgrindprocess.h
+++ b/src/plugins/valgrind/valgrindprocess.h
@@ -50,7 +50,7 @@ signals:
void logMessageReceived(const QByteArray &);
void processErrorReceived(const QString &, QProcess::ProcessError);
void valgrindStarted(qint64 pid);
- void done(bool success);
+ void done(Tasking::DoneResult result);
// Parser's signals
void status(const Valgrind::XmlProtocol::Status &status);
diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp
index df464e3324..72a393fe7c 100644
--- a/src/plugins/valgrind/xmlprotocol/parser.cpp
+++ b/src/plugins/valgrind/xmlprotocol/parser.cpp
@@ -25,6 +25,7 @@
#include <QWaitCondition>
#include <QXmlStreamReader>
+using namespace Tasking;
using namespace Utils;
namespace Valgrind::XmlProtocol {
@@ -710,7 +711,7 @@ public:
m_errorString = data.m_internalError;
});
QObject::connect(m_watcher.get(), &QFutureWatcherBase::finished, q, [this] {
- emit q->done(!m_errorString, *m_errorString);
+ emit q->done(toDoneResult(!m_errorString), *m_errorString);
m_watcher.release()->deleteLater();
m_thread.reset();
m_socket.reset();
@@ -786,8 +787,8 @@ bool Parser::runBlocking()
bool ok = false;
QEventLoop loop;
- const auto finalize = [&loop, &ok](bool success) {
- ok = success;
+ const auto finalize = [&loop, &ok](DoneResult result) {
+ ok = result == DoneResult::Success;
// Refer to the QObject::deleteLater() docs.
QMetaObject::invokeMethod(&loop, [&loop] { loop.quit(); }, Qt::QueuedConnection);
};
diff --git a/src/plugins/valgrind/xmlprotocol/parser.h b/src/plugins/valgrind/xmlprotocol/parser.h
index df34601bc3..9116ad6d81 100644
--- a/src/plugins/valgrind/xmlprotocol/parser.h
+++ b/src/plugins/valgrind/xmlprotocol/parser.h
@@ -45,7 +45,7 @@ signals:
void errorCount(qint64 unique, qint64 count);
void suppressionCount(const QString &name, qint64 count);
void announceThread(const AnnounceThread &announceThread);
- void done(bool success, const QString &errorString);
+ void done(Tasking::DoneResult result, const QString &errorString);
private:
std::unique_ptr<ParserPrivate> d;
diff --git a/tests/auto/solutions/tasking/tst_tasking.cpp b/tests/auto/solutions/tasking/tst_tasking.cpp
index ec90218f3a..da9929bff1 100644
--- a/tests/auto/solutions/tasking/tst_tasking.cpp
+++ b/tests/auto/solutions/tasking/tst_tasking.cpp
@@ -345,7 +345,7 @@ class TickAndDoneTaskAdapter : public TaskAdapter<TickAndDone>
{
public:
TickAndDoneTaskAdapter() { connect(task(), &TickAndDone::done, this,
- [this] { emit done(true); }); }
+ [this] { emit done(DoneResult::Success); }); }
void start() final { task()->start(); }
};
diff --git a/tests/auto/valgrind/memcheck/modeldemo.cpp b/tests/auto/valgrind/memcheck/modeldemo.cpp
index 4fe18f1bf8..eec6c16ae8 100644
--- a/tests/auto/valgrind/memcheck/modeldemo.cpp
+++ b/tests/auto/valgrind/memcheck/modeldemo.cpp
@@ -36,8 +36,8 @@ int main(int argc, char *argv[])
QObject::connect(&runner, &ValgrindProcess::processErrorReceived, &app, [](const QString &err) {
qDebug() << err;
});
- QObject::connect(&runner, &ValgrindProcess::done, &app, [](bool success) {
- qApp->exit(success ? 0 : 1);
+ QObject::connect(&runner, &ValgrindProcess::done, &app, [](Tasking::DoneResult result) {
+ qApp->exit(result == Tasking::DoneResult::Success ? 0 : 1);
});
ErrorListModel model;
QObject::connect(&runner, &ValgrindProcess::error, &model, &ErrorListModel::addError,