From fdfc558946a2e0d4322de82d60cbf9137eb64cd4 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 27 Oct 2021 16:23:22 +0200 Subject: [PATCH] ProjectExplorer: Use FilePath for CustomExecutableRC::executable ... and clean up #includes. Change-Id: Ia9c4c1d366b633e1cd017eabd07244891ab7ca57 Reviewed-by: Christian Kandeler --- .../customexecutablerunconfiguration.cpp | 33 +++---------------- .../customexecutablerunconfiguration.h | 2 +- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index c5e1c70ea67..80678ba841e 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -25,32 +25,10 @@ #include "customexecutablerunconfiguration.h" -#include "abi.h" -#include "buildconfiguration.h" #include "devicesupport/devicemanager.h" -#include "environmentaspect.h" #include "localenvironmentaspect.h" -#include "project.h" -#include "runcontrol.h" #include "target.h" -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - using namespace Utils; namespace ProjectExplorer { @@ -86,9 +64,9 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe setDefaultDisplayName(defaultDisplayName()); } -QString CustomExecutableRunConfiguration::rawExecutable() const +FilePath CustomExecutableRunConfiguration::executable() const { - return aspect()->executable().toString(); + return aspect()->executable(); } bool CustomExecutableRunConfiguration::isEnabled() const @@ -116,16 +94,15 @@ Runnable CustomExecutableRunConfiguration::runnable() const QString CustomExecutableRunConfiguration::defaultDisplayName() const { - if (rawExecutable().isEmpty()) + if (executable().isEmpty()) return tr("Custom Executable"); - else - return tr("Run %1").arg(QDir::toNativeSeparators(rawExecutable())); + return tr("Run %1").arg(executable().toUserOutput()); } Tasks CustomExecutableRunConfiguration::checkForIssues() const { Tasks tasks; - if (rawExecutable().isEmpty()) { + if (executable().isEmpty()) { tasks << createConfigurationIssue(tr("You need to set an executable in the custom run " "configuration.")); } diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index d7d90193bc5..c504658796a 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -46,7 +46,7 @@ private: Tasks checkForIssues() const override; void configurationDialogFinished(); - QString rawExecutable() const; + Utils::FilePath executable() const; }; class CustomExecutableRunConfigurationFactory : public FixedRunConfigurationFactory