Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c96ae095 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Rolf Eike Beer

make finding a launch configuration a bit more generic

parent bb2d6105
......@@ -22,6 +22,7 @@
#include "qttestdelegate.h"
#include <debug.h>
#include <algorithm>
#include <interfaces/ilaunchconfiguration.h>
#include <interfaces/icore.h>
#include <interfaces/itestcontroller.h>
......@@ -72,14 +73,15 @@ static KJob* createTestJob(const QString& launchModeId, const QStringList& argum
}
Q_ASSERT(launcher);
ILaunchConfiguration* ilaunch = nullptr;
const QList<ILaunchConfiguration*> launchConfigurations = ICore::self()->runController()->launchConfigurations();
for (ILaunchConfiguration* l : launchConfigurations) {
if (l->type() == type && l->config().readEntry("ConfiguredByCTest", false)) {
ilaunch = l;
break;
}
}
auto ilaunch = [type]() {
const auto launchConfigurations = ICore::self()->runController()->launchConfigurations();
auto it = std::find_if(launchConfigurations.begin(), launchConfigurations.end(),
[type](ILaunchConfiguration* l) {
return (l->type() == type && l->config().readEntry("ConfiguredByCTest", false));
});
return it == launchConfigurations.end() ? nullptr : *it;
}();
if (!ilaunch) {
ilaunch = ICore::self()->runController()->createLaunchConfiguration( type,
qMakePair( mode->id(), launcher->id() ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment