RunWorkerFactory: Drop support for mangled config ids

Change-Id: I41f509218c82dadbb97c2222766554c04759d9f3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2025-06-10 13:10:18 +02:00
parent ec34c9bbd6
commit 3fe36eaaa7
2 changed files with 10 additions and 23 deletions

View File

@@ -130,26 +130,13 @@ void RunWorkerFactory::cloneProduct(Id exitstingStepId)
QTC_CHECK(false);
}
bool RunWorkerFactory::canCreate(Id runMode, Id deviceType, const QString &runConfigId) const
bool RunWorkerFactory::canCreate(Id runMode, Id deviceType, Id runConfigId) const
{
if (!m_supportedRunModes.contains(runMode))
return false;
if (!m_supportedRunConfigurations.isEmpty()) {
// FIXME: That's to be used after mangled ids are gone.
//if (!m_supportedRunConfigurations.contains(runConfigId)
// return false;
bool ok = false;
for (const Id &id : m_supportedRunConfigurations) {
if (runConfigId.startsWith(id.toString())) {
ok = true;
break;
}
}
if (!ok)
return false;
}
if (!m_supportedRunConfigurations.isEmpty() && !m_supportedRunConfigurations.contains(runConfigId))
return false;
if (!m_supportedDeviceTypes.isEmpty())
return m_supportedDeviceTypes.contains(deviceType);
@@ -181,7 +168,7 @@ void RunWorkerFactory::dumpAll()
std::placeholders::_1,
runMode,
device,
runConfig.toString());
runConfig);
const auto factory = findOrDefault(g_runWorkerFactories, check);
qDebug() << "MODE:" << runMode << device << runConfig << factory;
}
@@ -504,7 +491,7 @@ RunWorker *RunControl::createWorker(Id runMode)
{
const Id deviceType = RunDeviceTypeKitAspect::deviceTypeId(d->kit);
for (RunWorkerFactory *factory : std::as_const(g_runWorkerFactories)) {
if (factory->canCreate(runMode, deviceType, d->runConfigId.toString()))
if (factory->canCreate(runMode, deviceType, d->runConfigId))
return factory->create(this);
}
return nullptr;
@@ -514,7 +501,7 @@ Group RunControl::createRecipe(Id runMode)
{
const Id deviceType = RunDeviceTypeKitAspect::deviceTypeId(d->kit);
for (RunWorkerFactory *factory : std::as_const(g_runWorkerFactories)) {
if (factory->canCreate(runMode, deviceType, d->runConfigId.toString()))
if (factory->canCreate(runMode, deviceType, d->runConfigId))
return factory->createRecipe(this);
}
return noRecipeTask();
@@ -526,7 +513,7 @@ bool RunControl::createMainWorker()
= filtered(g_runWorkerFactories, [this](RunWorkerFactory *factory) {
return factory->canCreate(d->runMode,
RunDeviceTypeKitAspect::deviceTypeId(d->kit),
d->runConfigId.toString());
d->runConfigId);
});
// There might be combinations that cannot run. But that should have been checked
@@ -542,7 +529,7 @@ bool RunControl::createMainWorker()
bool RunControl::canRun(Id runMode, Id deviceType, Utils::Id runConfigId)
{
for (const RunWorkerFactory *factory : std::as_const(g_runWorkerFactories)) {
if (factory->canCreate(runMode, deviceType, runConfigId.toString()))
if (factory->canCreate(runMode, deviceType, runConfigId))
return true;
}
return false;
@@ -1700,7 +1687,7 @@ private slots:
for (Id runConfig : std::as_const(g_runConfigs)) {
QList<Id> creators;
for (RunWorkerFactory *factory : g_runWorkerFactories) {
if (factory->canCreate(runMode, device, runConfig.toString()))
if (factory->canCreate(runMode, device, runConfig))
creators.append(factory->id());
}
if (!creators.isEmpty())

View File

@@ -89,7 +89,7 @@ protected:
private:
friend class RunControl;
friend class Internal::RunWorkerConflictTest;
bool canCreate(Utils::Id runMode, Utils::Id deviceType, const QString &runConfigId) const;
bool canCreate(Utils::Id runMode, Utils::Id deviceType, Utils::Id runConfigId) const;
RunWorker *create(RunControl *runControl) const;
Tasking::Group createRecipe(RunControl *runControl) const;