ProjectExplorer: Use FilePath for CustomExecutableRC::executable

... and clean up #includes.

Change-Id: Ia9c4c1d366b633e1cd017eabd07244891ab7ca57
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2021-10-27 16:23:22 +02:00
parent c6bc5583d6
commit fdfc558946
2 changed files with 6 additions and 29 deletions

View File

@@ -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 <coreplugin/icore.h>
#include <utils/detailswidget.h>
#include <utils/pathchooser.h>
#include <utils/stringutils.h>
#include <utils/variablechooser.h>
#include <QDialog>
#include <QDialogButtonBox>
#include <QDir>
#include <QFormLayout>
#include <QKeyEvent>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
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<ExecutableAspect>()->executable().toString();
return aspect<ExecutableAspect>()->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."));
}

View File

@@ -46,7 +46,7 @@ private:
Tasks checkForIssues() const override;
void configurationDialogFinished();
QString rawExecutable() const;
Utils::FilePath executable() const;
};
class CustomExecutableRunConfigurationFactory : public FixedRunConfigurationFactory