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");
|
||||
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()));
|
||||
|
||||
@@ -7,12 +7,11 @@
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
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:
|
||||
|
||||
@@ -46,9 +46,8 @@ MakeStep::MakeStep(BuildStepList *parent, Id id)
|
||||
|
||||
setCommandLineProvider([this] { return effectiveMakeCommand(Execution); });
|
||||
|
||||
m_makeCommandAspect = addAspect<StringAspect>();
|
||||
m_makeCommandAspect = addAspect<FilePathAspect>();
|
||||
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");
|
||||
|
||||
@@ -34,9 +34,8 @@ public:
|
||||
ProcessStep::ProcessStep(BuildStepList *bsl, Id id)
|
||||
: AbstractProcessStep(bsl, id)
|
||||
{
|
||||
auto command = addAspect<StringAspect>();
|
||||
auto command = addAspect<FilePathAspect>();
|
||||
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<StringAspect>();
|
||||
auto workingDirectory = addAspect<FilePathAspect>();
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user