forked from qt-creator/qt-creator
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:
@@ -130,26 +130,13 @@ void RunWorkerFactory::cloneProduct(Id exitstingStepId)
|
|||||||
QTC_CHECK(false);
|
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))
|
if (!m_supportedRunModes.contains(runMode))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!m_supportedRunConfigurations.isEmpty()) {
|
if (!m_supportedRunConfigurations.isEmpty() && !m_supportedRunConfigurations.contains(runConfigId))
|
||||||
// FIXME: That's to be used after mangled ids are gone.
|
return false;
|
||||||
//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_supportedDeviceTypes.isEmpty())
|
if (!m_supportedDeviceTypes.isEmpty())
|
||||||
return m_supportedDeviceTypes.contains(deviceType);
|
return m_supportedDeviceTypes.contains(deviceType);
|
||||||
@@ -181,7 +168,7 @@ void RunWorkerFactory::dumpAll()
|
|||||||
std::placeholders::_1,
|
std::placeholders::_1,
|
||||||
runMode,
|
runMode,
|
||||||
device,
|
device,
|
||||||
runConfig.toString());
|
runConfig);
|
||||||
const auto factory = findOrDefault(g_runWorkerFactories, check);
|
const auto factory = findOrDefault(g_runWorkerFactories, check);
|
||||||
qDebug() << "MODE:" << runMode << device << runConfig << factory;
|
qDebug() << "MODE:" << runMode << device << runConfig << factory;
|
||||||
}
|
}
|
||||||
@@ -504,7 +491,7 @@ RunWorker *RunControl::createWorker(Id runMode)
|
|||||||
{
|
{
|
||||||
const Id deviceType = RunDeviceTypeKitAspect::deviceTypeId(d->kit);
|
const Id deviceType = RunDeviceTypeKitAspect::deviceTypeId(d->kit);
|
||||||
for (RunWorkerFactory *factory : std::as_const(g_runWorkerFactories)) {
|
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 factory->create(this);
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -514,7 +501,7 @@ Group RunControl::createRecipe(Id runMode)
|
|||||||
{
|
{
|
||||||
const Id deviceType = RunDeviceTypeKitAspect::deviceTypeId(d->kit);
|
const Id deviceType = RunDeviceTypeKitAspect::deviceTypeId(d->kit);
|
||||||
for (RunWorkerFactory *factory : std::as_const(g_runWorkerFactories)) {
|
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 factory->createRecipe(this);
|
||||||
}
|
}
|
||||||
return noRecipeTask();
|
return noRecipeTask();
|
||||||
@@ -526,7 +513,7 @@ bool RunControl::createMainWorker()
|
|||||||
= filtered(g_runWorkerFactories, [this](RunWorkerFactory *factory) {
|
= filtered(g_runWorkerFactories, [this](RunWorkerFactory *factory) {
|
||||||
return factory->canCreate(d->runMode,
|
return factory->canCreate(d->runMode,
|
||||||
RunDeviceTypeKitAspect::deviceTypeId(d->kit),
|
RunDeviceTypeKitAspect::deviceTypeId(d->kit),
|
||||||
d->runConfigId.toString());
|
d->runConfigId);
|
||||||
});
|
});
|
||||||
|
|
||||||
// There might be combinations that cannot run. But that should have been checked
|
// 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)
|
bool RunControl::canRun(Id runMode, Id deviceType, Utils::Id runConfigId)
|
||||||
{
|
{
|
||||||
for (const RunWorkerFactory *factory : std::as_const(g_runWorkerFactories)) {
|
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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -1700,7 +1687,7 @@ private slots:
|
|||||||
for (Id runConfig : std::as_const(g_runConfigs)) {
|
for (Id runConfig : std::as_const(g_runConfigs)) {
|
||||||
QList<Id> creators;
|
QList<Id> creators;
|
||||||
for (RunWorkerFactory *factory : g_runWorkerFactories) {
|
for (RunWorkerFactory *factory : g_runWorkerFactories) {
|
||||||
if (factory->canCreate(runMode, device, runConfig.toString()))
|
if (factory->canCreate(runMode, device, runConfig))
|
||||||
creators.append(factory->id());
|
creators.append(factory->id());
|
||||||
}
|
}
|
||||||
if (!creators.isEmpty())
|
if (!creators.isEmpty())
|
||||||
|
@@ -89,7 +89,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
friend class RunControl;
|
friend class RunControl;
|
||||||
friend class Internal::RunWorkerConflictTest;
|
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;
|
RunWorker *create(RunControl *runControl) const;
|
||||||
Tasking::Group createRecipe(RunControl *runControl) const;
|
Tasking::Group createRecipe(RunControl *runControl) const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user