TaskTree tasks: Make task naming consistent

Task-number: QTCREATORBUG-29102
Change-Id: I96dfde58b684a3b48704778b92cdf2f869bbb7b1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
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-05-18 19:14:39 +02:00
parent 376c1cf246
commit 5ae82a88cf
8 changed files with 28 additions and 28 deletions

View File

@@ -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<void> &async) {

View File

@@ -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<ResultsCollector>
class ResultsCollectorTaskAdapter : public TaskAdapter<ResultsCollector>
{
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
}

View File

@@ -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)

View File

@@ -44,11 +44,14 @@ private:
Internal::DeviceUsedPortsGathererPrivate * const d;
};
class PROJECTEXPLORER_EXPORT DeviceUsedPortsGathererAdapter
class PROJECTEXPLORER_EXPORT DeviceUsedPortsGathererTaskAdapter
: public Tasking::TaskAdapter<DeviceUsedPortsGatherer>
{
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);

View File

@@ -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();
}

View File

@@ -277,13 +277,14 @@ private:
QString m_errorString;
};
class PROJECTEXPLORER_EXPORT KillerAdapter : public Tasking::TaskAdapter<DeviceProcessKiller>
class PROJECTEXPLORER_EXPORT DeviceProcessKillerTaskAdapter
: public Tasking::TaskAdapter<DeviceProcessKiller>
{
public:
KillerAdapter();
DeviceProcessKillerTaskAdapter();
void start() final;
};
} // namespace ProjectExplorer
TASKING_DECLARE_TASK(Killer, ProjectExplorer::KillerAdapter);
TASKING_DECLARE_TASK(DeviceProcessKillerTask, ProjectExplorer::DeviceProcessKillerTaskAdapter);

View File

@@ -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()

View File

@@ -160,7 +160,7 @@ TaskItem GenericLinuxDeviceTesterPrivate::gathererTask() const
return Group {
optional,
PortGatherer(setup, done, error)
DeviceUsedPortsGathererTask(setup, done, error)
};
}