forked from qt-creator/qt-creator
Autotest: Use more FilePath
Change-Id: I15de1121305f245274d74b4116786f6f07ffa3c2 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -487,7 +487,7 @@ QVector<QObject *> AutotestPlugin::createTestObjects() const
|
||||
|
||||
bool ChoicePair::matches(const ProjectExplorer::RunConfiguration *rc) const
|
||||
{
|
||||
return rc && rc->displayName() == displayName && rc->runnable().command.executable().toString() == executable;
|
||||
return rc && rc->displayName() == displayName && rc->runnable().command.executable() == executable;
|
||||
}
|
||||
|
||||
} // Internal
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <utils/filepath.h>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Project;
|
||||
class RunConfiguration;
|
||||
@@ -20,12 +22,12 @@ struct TestSettings;
|
||||
|
||||
struct ChoicePair
|
||||
{
|
||||
explicit ChoicePair(const QString &name = QString(), const QString &exe = QString())
|
||||
explicit ChoicePair(const QString &name = {}, const Utils::FilePath &exe = {})
|
||||
: displayName(name), executable(exe) {}
|
||||
bool matches(const ProjectExplorer::RunConfiguration *rc) const;
|
||||
|
||||
QString displayName;
|
||||
QString executable;
|
||||
Utils::FilePath executable;
|
||||
};
|
||||
|
||||
class AutotestPlugin : public ExtensionSystem::IPlugin
|
||||
|
||||
@@ -446,11 +446,11 @@ static RunConfiguration *getRunConfiguration(const QString &buildTargetKey)
|
||||
if (dName.isEmpty())
|
||||
return nullptr;
|
||||
// run configuration has been selected - fill config based on this one..
|
||||
const QString exe = dialog.executable();
|
||||
const FilePath exe = FilePath::fromString(dialog.executable());
|
||||
runConfig = Utils::findOr(runConfigurations, nullptr, [&dName, &exe] (const RunConfiguration *rc) {
|
||||
if (rc->displayName() != dName)
|
||||
return false;
|
||||
return rc->runnable().command.executable().toString() == exe;
|
||||
return rc->runnable().command.executable() == exe;
|
||||
});
|
||||
if (runConfig && dialog.rememberChoice())
|
||||
AutotestPlugin::cacheRunConfigChoice(buildTargetKey, ChoicePair(dName, exe));
|
||||
|
||||
Reference in New Issue
Block a user