forked from qt-creator/qt-creator
ProjectExplorer: Use FilePathAspect for some FilePaths
Change-Id: I35d55c82217e9ef9bbcf215c8360a111931c822c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -41,7 +41,6 @@ BuildDirectoryAspect::BuildDirectoryAspect(const BuildConfiguration *bc)
|
|||||||
{
|
{
|
||||||
setSettingsKey("ProjectExplorer.BuildConfiguration.BuildDirectory");
|
setSettingsKey("ProjectExplorer.BuildConfiguration.BuildDirectory");
|
||||||
setLabelText(Tr::tr("Build directory:"));
|
setLabelText(Tr::tr("Build directory:"));
|
||||||
setDisplayStyle(PathChooserDisplay);
|
|
||||||
setExpectedKind(Utils::PathChooser::Directory);
|
setExpectedKind(Utils::PathChooser::Directory);
|
||||||
setValidationFunction([this](FancyLineEdit *edit, QString *error) {
|
setValidationFunction([this](FancyLineEdit *edit, QString *error) {
|
||||||
const FilePath fixedDir = fixupDir(FilePath::fromUserInput(edit->text()));
|
const FilePath fixedDir = fixupDir(FilePath::fromUserInput(edit->text()));
|
||||||
|
|||||||
@@ -7,12 +7,11 @@
|
|||||||
|
|
||||||
#include <utils/aspects.h>
|
#include <utils/aspects.h>
|
||||||
|
|
||||||
namespace Utils { class FilePath; }
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class BuildConfiguration;
|
class BuildConfiguration;
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT BuildDirectoryAspect : public Utils::StringAspect
|
class PROJECTEXPLORER_EXPORT BuildDirectoryAspect : public Utils::FilePathAspect
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ MakeStep::MakeStep(BuildStepList *parent, Id id)
|
|||||||
|
|
||||||
setCommandLineProvider([this] { return effectiveMakeCommand(Execution); });
|
setCommandLineProvider([this] { return effectiveMakeCommand(Execution); });
|
||||||
|
|
||||||
m_makeCommandAspect = addAspect<StringAspect>();
|
m_makeCommandAspect = addAspect<FilePathAspect>();
|
||||||
m_makeCommandAspect->setSettingsKey(id.withSuffix(MAKE_COMMAND_SUFFIX).toString());
|
m_makeCommandAspect->setSettingsKey(id.withSuffix(MAKE_COMMAND_SUFFIX).toString());
|
||||||
m_makeCommandAspect->setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
||||||
m_makeCommandAspect->setExpectedKind(PathChooser::ExistingCommand);
|
m_makeCommandAspect->setExpectedKind(PathChooser::ExistingCommand);
|
||||||
m_makeCommandAspect->setBaseFileName(PathChooser::homePath());
|
m_makeCommandAspect->setBaseFileName(PathChooser::homePath());
|
||||||
m_makeCommandAspect->setHistoryCompleter("PE.MakeCommand.History");
|
m_makeCommandAspect->setHistoryCompleter("PE.MakeCommand.History");
|
||||||
|
|||||||
@@ -34,9 +34,8 @@ public:
|
|||||||
ProcessStep::ProcessStep(BuildStepList *bsl, Id id)
|
ProcessStep::ProcessStep(BuildStepList *bsl, Id id)
|
||||||
: AbstractProcessStep(bsl, id)
|
: AbstractProcessStep(bsl, id)
|
||||||
{
|
{
|
||||||
auto command = addAspect<StringAspect>();
|
auto command = addAspect<FilePathAspect>();
|
||||||
command->setSettingsKey(PROCESS_COMMAND_KEY);
|
command->setSettingsKey(PROCESS_COMMAND_KEY);
|
||||||
command->setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
||||||
command->setLabelText(Tr::tr("Command:"));
|
command->setLabelText(Tr::tr("Command:"));
|
||||||
command->setExpectedKind(PathChooser::Command);
|
command->setExpectedKind(PathChooser::Command);
|
||||||
command->setHistoryCompleter("PE.ProcessStepCommand.History");
|
command->setHistoryCompleter("PE.ProcessStepCommand.History");
|
||||||
@@ -46,10 +45,9 @@ ProcessStep::ProcessStep(BuildStepList *bsl, Id id)
|
|||||||
arguments->setDisplayStyle(StringAspect::LineEditDisplay);
|
arguments->setDisplayStyle(StringAspect::LineEditDisplay);
|
||||||
arguments->setLabelText(Tr::tr("Arguments:"));
|
arguments->setLabelText(Tr::tr("Arguments:"));
|
||||||
|
|
||||||
auto workingDirectory = addAspect<StringAspect>();
|
auto workingDirectory = addAspect<FilePathAspect>();
|
||||||
workingDirectory->setSettingsKey(PROCESS_WORKINGDIRECTORY_KEY);
|
workingDirectory->setSettingsKey(PROCESS_WORKINGDIRECTORY_KEY);
|
||||||
workingDirectory->setValue(Constants::DEFAULT_WORKING_DIR);
|
workingDirectory->setValue(Constants::DEFAULT_WORKING_DIR);
|
||||||
workingDirectory->setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
||||||
workingDirectory->setLabelText(Tr::tr("Working directory:"));
|
workingDirectory->setLabelText(Tr::tr("Working directory:"));
|
||||||
workingDirectory->setExpectedKind(PathChooser::Directory);
|
workingDirectory->setExpectedKind(PathChooser::Directory);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user