ProjectExplorer: Use manual loop in RunControl::canRun() implementation

I find the std::bind version much harder to debug.

Change-Id: I0badb4c29097a5432b110a815cb2206477091d98
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2021-04-12 17:19:48 +02:00
parent 05324cf21f
commit 4059c27d7a

View File

@@ -494,12 +494,11 @@ bool RunControl::createMainWorker()
bool RunControl::canRun(Utils::Id runMode, Utils::Id deviceType, Utils::Id runConfigId) bool RunControl::canRun(Utils::Id runMode, Utils::Id deviceType, Utils::Id runConfigId)
{ {
const auto check = std::bind(&RunWorkerFactory::canRun, for (const RunWorkerFactory *factory : qAsConst(g_runWorkerFactories)) {
std::placeholders::_1, if (factory->canRun(runMode, deviceType, runConfigId.toString()))
runMode, return true;
deviceType, }
runConfigId.toString()); return false;
return Utils::contains(g_runWorkerFactories, check);
} }
void RunControlPrivate::initiateStart() void RunControlPrivate::initiateStart()