From 01019dfdb87506cd6faa3f29913431a1e826cf8d Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 23 May 2023 14:42:41 +0200 Subject: [PATCH] ProjectExplorer: Use FilePathAspect for some FilePaths Change-Id: I35d55c82217e9ef9bbcf215c8360a111931c822c Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/buildaspects.cpp | 1 - src/plugins/projectexplorer/buildaspects.h | 5 ++--- src/plugins/projectexplorer/makestep.cpp | 3 +-- src/plugins/projectexplorer/processstep.cpp | 6 ++---- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/plugins/projectexplorer/buildaspects.cpp b/src/plugins/projectexplorer/buildaspects.cpp index e4cbf6903b7..606911654fd 100644 --- a/src/plugins/projectexplorer/buildaspects.cpp +++ b/src/plugins/projectexplorer/buildaspects.cpp @@ -41,7 +41,6 @@ BuildDirectoryAspect::BuildDirectoryAspect(const BuildConfiguration *bc) { setSettingsKey("ProjectExplorer.BuildConfiguration.BuildDirectory"); setLabelText(Tr::tr("Build directory:")); - setDisplayStyle(PathChooserDisplay); setExpectedKind(Utils::PathChooser::Directory); setValidationFunction([this](FancyLineEdit *edit, QString *error) { const FilePath fixedDir = fixupDir(FilePath::fromUserInput(edit->text())); diff --git a/src/plugins/projectexplorer/buildaspects.h b/src/plugins/projectexplorer/buildaspects.h index 96c6db90716..bcc8987cd0c 100644 --- a/src/plugins/projectexplorer/buildaspects.h +++ b/src/plugins/projectexplorer/buildaspects.h @@ -7,12 +7,11 @@ #include -namespace Utils { class FilePath; } - namespace ProjectExplorer { + class BuildConfiguration; -class PROJECTEXPLORER_EXPORT BuildDirectoryAspect : public Utils::StringAspect +class PROJECTEXPLORER_EXPORT BuildDirectoryAspect : public Utils::FilePathAspect { Q_OBJECT public: diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp index 56b04b4b7f6..ee9ffea832b 100644 --- a/src/plugins/projectexplorer/makestep.cpp +++ b/src/plugins/projectexplorer/makestep.cpp @@ -46,9 +46,8 @@ MakeStep::MakeStep(BuildStepList *parent, Id id) setCommandLineProvider([this] { return effectiveMakeCommand(Execution); }); - m_makeCommandAspect = addAspect(); + m_makeCommandAspect = addAspect(); m_makeCommandAspect->setSettingsKey(id.withSuffix(MAKE_COMMAND_SUFFIX).toString()); - m_makeCommandAspect->setDisplayStyle(StringAspect::PathChooserDisplay); m_makeCommandAspect->setExpectedKind(PathChooser::ExistingCommand); m_makeCommandAspect->setBaseFileName(PathChooser::homePath()); m_makeCommandAspect->setHistoryCompleter("PE.MakeCommand.History"); diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index 3ced1622d0d..a34ff10b611 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -34,9 +34,8 @@ public: ProcessStep::ProcessStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, id) { - auto command = addAspect(); + auto command = addAspect(); command->setSettingsKey(PROCESS_COMMAND_KEY); - command->setDisplayStyle(StringAspect::PathChooserDisplay); command->setLabelText(Tr::tr("Command:")); command->setExpectedKind(PathChooser::Command); command->setHistoryCompleter("PE.ProcessStepCommand.History"); @@ -46,10 +45,9 @@ ProcessStep::ProcessStep(BuildStepList *bsl, Id id) arguments->setDisplayStyle(StringAspect::LineEditDisplay); arguments->setLabelText(Tr::tr("Arguments:")); - auto workingDirectory = addAspect(); + auto workingDirectory = addAspect(); workingDirectory->setSettingsKey(PROCESS_WORKINGDIRECTORY_KEY); workingDirectory->setValue(Constants::DEFAULT_WORKING_DIR); - workingDirectory->setDisplayStyle(StringAspect::PathChooserDisplay); workingDirectory->setLabelText(Tr::tr("Working directory:")); workingDirectory->setExpectedKind(PathChooser::Directory);