From 5ae82a88cf8e8572aa4e948fc1cbc3732aa1f440 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 18 May 2023 19:14:39 +0200 Subject: [PATCH] TaskTree tasks: Make task naming consistent Task-number: QTCREATORBUG-29102 Change-Id: I96dfde58b684a3b48704778b92cdf2f869bbb7b1 Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: hjk --- src/libs/utils/filestreamer.cpp | 12 ++++++------ src/plugins/coreplugin/locator/ilocatorfilter.cpp | 11 ++++++----- .../devicesupport/deviceusedportsgatherer.cpp | 6 ------ .../devicesupport/deviceusedportsgatherer.h | 10 +++++++--- .../projectexplorer/devicesupport/idevice.cpp | 6 +++--- src/plugins/projectexplorer/devicesupport/idevice.h | 7 ++++--- src/plugins/remotelinux/killappstep.cpp | 2 +- src/plugins/remotelinux/linuxdevicetester.cpp | 2 +- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/libs/utils/filestreamer.cpp b/src/libs/utils/filestreamer.cpp index ababb94cf68..d24b61dbde3 100644 --- a/src/libs/utils/filestreamer.cpp +++ b/src/libs/utils/filestreamer.cpp @@ -306,8 +306,8 @@ public: } // namespace Utils -TASKING_DECLARE_TASK(Reader, Utils::FileStreamReaderAdapter); -TASKING_DECLARE_TASK(Writer, Utils::FileStreamWriterAdapter); +TASKING_DECLARE_TASK(FileStreamReaderTask, Utils::FileStreamReaderAdapter); +TASKING_DECLARE_TASK(FileStreamWriterTask, Utils::FileStreamWriterAdapter); namespace Utils { @@ -353,10 +353,10 @@ static Group interDeviceTransferTask(const FilePath &source, const FilePath &des Storage(writerReadyBarrier), parallel, Storage(storage), - Writer(setupWriter), + FileStreamWriterTask(setupWriter), Group { WaitForBarrierTask(writerReadyBarrier), - Reader(setupReader, finalizeReader, finalizeReader) + FileStreamReaderTask(setupReader, finalizeReader, finalizeReader) } }; @@ -408,14 +408,14 @@ private: m_readBuffer += data; }); }; - return Reader(setup); + return FileStreamReaderTask(setup); } TaskItem writerTask() { const auto setup = [this](FileStreamWriter &writer) { writer.setFilePath(m_destination); writer.setWriteData(m_writeBuffer); }; - return Writer(setup); + return FileStreamWriterTask(setup); } TaskItem transferTask() { const auto setup = [this](Async &async) { diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp index 1a08792382b..18f9dfd29d7 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp @@ -244,7 +244,8 @@ private: // When all the results are reported (the expected number of reports is set with setFilterCount()), // the ResultsCollector finishes. The intermediate results are reported with // serialOutputDataReady() signal. -// The object of ResultsCollector is registered in Tasking namespace under the Collector name. +// The object of ResultsCollector is registered in Tasking namespace under the +// ResultsCollectorTask name. class ResultsCollector : public QObject { Q_OBJECT @@ -317,10 +318,10 @@ void ResultsCollector::start() m_watcher->setFuture(Utils::asyncRun(deduplicate, m_deduplicator)); } -class ResultsCollectorAdapter : public TaskAdapter +class ResultsCollectorTaskAdapter : public TaskAdapter { public: - ResultsCollectorAdapter() { + ResultsCollectorTaskAdapter() { connect(task(), &ResultsCollector::done, this, [this] { emit done(true); }); } void start() final { task()->start(); } @@ -328,7 +329,7 @@ public: } // namespace Core -TASKING_DECLARE_TASK(Collector, Core::ResultsCollectorAdapter); +TASKING_DECLARE_TASK(ResultsCollectorTask, Core::ResultsCollectorTaskAdapter); namespace Core { @@ -483,7 +484,7 @@ void LocatorMatcher::start() const Group root { parallel, Storage(collectorStorage), - Collector(onCollectorSetup, onCollectorDone, onCollectorDone), + ResultsCollectorTask(onCollectorSetup, onCollectorDone, onCollectorDone), Group { parallelTasks } diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp index fbe300bf269..c3f3f195ca1 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp @@ -116,12 +116,6 @@ void DeviceUsedPortsGatherer::handleProcessDone() stop(); } -DeviceUsedPortsGathererAdapter::DeviceUsedPortsGathererAdapter() -{ - connect(task(), &DeviceUsedPortsGatherer::portListReady, this, [this] { emit done(true); }); - connect(task(), &DeviceUsedPortsGatherer::error, this, [this] { emit done(false); }); -} - // PortGatherer PortsGatherer::PortsGatherer(RunControl *runControl) diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h index 7be6f9c4855..20b0c9c9e8f 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h @@ -44,11 +44,14 @@ private: Internal::DeviceUsedPortsGathererPrivate * const d; }; -class PROJECTEXPLORER_EXPORT DeviceUsedPortsGathererAdapter +class PROJECTEXPLORER_EXPORT DeviceUsedPortsGathererTaskAdapter : public Tasking::TaskAdapter { public: - DeviceUsedPortsGathererAdapter(); + DeviceUsedPortsGathererTaskAdapter() { + connect(task(), &DeviceUsedPortsGatherer::portListReady, this, [this] { emit done(true); }); + connect(task(), &DeviceUsedPortsGatherer::error, this, [this] { emit done(false); }); + } void start() final { task()->start(); } }; @@ -86,4 +89,5 @@ private: } // namespace ProjectExplorer -TASKING_DECLARE_TASK(PortGatherer, ProjectExplorer::DeviceUsedPortsGathererAdapter); +TASKING_DECLARE_TASK(DeviceUsedPortsGathererTask, + ProjectExplorer::DeviceUsedPortsGathererTaskAdapter); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 775f60e396d..50f552444b3 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -695,12 +695,12 @@ void DeviceProcessKiller::start() m_signalOperation->killProcess(m_processPath.path()); } -KillerAdapter::KillerAdapter() +DeviceProcessKillerTaskAdapter::DeviceProcessKillerTaskAdapter() { - connect(task(), &DeviceProcessKiller::done, this, &KillerAdapter::done); + connect(task(), &DeviceProcessKiller::done, this, &TaskInterface::done); } -void KillerAdapter::start() +void DeviceProcessKillerTaskAdapter::start() { task()->start(); } diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index f0a902227ad..e28f88aaf46 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -277,13 +277,14 @@ private: QString m_errorString; }; -class PROJECTEXPLORER_EXPORT KillerAdapter : public Tasking::TaskAdapter +class PROJECTEXPLORER_EXPORT DeviceProcessKillerTaskAdapter + : public Tasking::TaskAdapter { public: - KillerAdapter(); + DeviceProcessKillerTaskAdapter(); void start() final; }; } // namespace ProjectExplorer -TASKING_DECLARE_TASK(Killer, ProjectExplorer::KillerAdapter); +TASKING_DECLARE_TASK(DeviceProcessKillerTask, ProjectExplorer::DeviceProcessKillerTaskAdapter); diff --git a/src/plugins/remotelinux/killappstep.cpp b/src/plugins/remotelinux/killappstep.cpp index df8d701dcfc..d3ec72e8895 100644 --- a/src/plugins/remotelinux/killappstep.cpp +++ b/src/plugins/remotelinux/killappstep.cpp @@ -57,7 +57,7 @@ Group KillAppStep::deployRecipe() addProgressMessage(Tr::tr("Failed to kill remote application. " "Assuming it was not running.")); }; - return Group { Killer(setupHandler, doneHandler, errorHandler) }; + return Group { DeviceProcessKillerTask(setupHandler, doneHandler, errorHandler) }; } KillAppStepFactory::KillAppStepFactory() diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index c32cabfee10..e1a209664fe 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -160,7 +160,7 @@ TaskItem GenericLinuxDeviceTesterPrivate::gathererTask() const return Group { optional, - PortGatherer(setup, done, error) + DeviceUsedPortsGathererTask(setup, done, error) }; }