forked from qt-creator/qt-creator
Use more FilePathAspect
Change-Id: Ib348df1460f8610607251498b07010df58d51ddf Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -22,8 +22,6 @@ GeneralSettings::GeneralSettings()
|
|||||||
setDisplayCategory(Tr::tr("Beautifier"));
|
setDisplayCategory(Tr::tr("Beautifier"));
|
||||||
setCategoryIconPath(":/beautifier/images/settingscategory_beautifier.png");
|
setCategoryIconPath(":/beautifier/images/settingscategory_beautifier.png");
|
||||||
setSettingsGroups("Beautifier", "General");
|
setSettingsGroups("Beautifier", "General");
|
||||||
setSettings(this);
|
|
||||||
setAutoApply(false);
|
|
||||||
|
|
||||||
registerAspect(&autoFormatOnSave);
|
registerAspect(&autoFormatOnSave);
|
||||||
autoFormatOnSave.setSettingsKey(Utils::Constants::BEAUTIFIER_AUTO_FORMAT_ON_SAVE);
|
autoFormatOnSave.setSettingsKey(Utils::Constants::BEAUTIFIER_AUTO_FORMAT_ON_SAVE);
|
||||||
@@ -47,9 +45,9 @@ GeneralSettings::GeneralSettings()
|
|||||||
autoFormatMime.setLabelText(Tr::tr("Restrict to MIME types:"));
|
autoFormatMime.setLabelText(Tr::tr("Restrict to MIME types:"));
|
||||||
autoFormatMime.setDisplayStyle(StringAspect::LineEditDisplay);
|
autoFormatMime.setDisplayStyle(StringAspect::LineEditDisplay);
|
||||||
|
|
||||||
setLayouter([this](QWidget *widget) {
|
setLayouter([this] {
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
Column {
|
return Column {
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Automatic Formatting on File Save")),
|
title(Tr::tr("Automatic Formatting on File Save")),
|
||||||
autoFormatOnSave.groupChecker(),
|
autoFormatOnSave.groupChecker(),
|
||||||
@@ -60,7 +58,7 @@ GeneralSettings::GeneralSettings()
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
st
|
st
|
||||||
}.attachTo(widget);
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2079,8 +2079,8 @@ void CMakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
auto settings = CMakeSpecificSettings::instance();
|
auto settings = CMakeSpecificSettings::instance();
|
||||||
if (!settings->ninjaPath.filePath().isEmpty()) {
|
if (!settings->ninjaPath().isEmpty()) {
|
||||||
const Utils::FilePath ninja = settings->ninjaPath.filePath();
|
const Utils::FilePath ninja = settings->ninjaPath();
|
||||||
env.appendOrSetPath(ninja.isFile() ? ninja.parentDir() : ninja);
|
env.appendOrSetPath(ninja.isFile() ? ninja.parentDir() : ninja);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,6 @@ public:
|
|||||||
|
|
||||||
registerAspect(&command);
|
registerAspect(&command);
|
||||||
command.setSettingsKey("autoFormatCommand");
|
command.setSettingsKey("autoFormatCommand");
|
||||||
command.setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
||||||
command.setDefaultValue("cmake-format");
|
command.setDefaultValue("cmake-format");
|
||||||
command.setExpectedKind(PathChooser::ExistingCommand);
|
command.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
|
|
||||||
@@ -121,14 +120,14 @@ public:
|
|||||||
TextEditor::Command formatCommand() const
|
TextEditor::Command formatCommand() const
|
||||||
{
|
{
|
||||||
TextEditor::Command cmd;
|
TextEditor::Command cmd;
|
||||||
cmd.setExecutable(command.filePath());
|
cmd.setExecutable(command());
|
||||||
cmd.setProcessing(TextEditor::Command::FileProcessing);
|
cmd.setProcessing(TextEditor::Command::FileProcessing);
|
||||||
cmd.addOption("--in-place");
|
cmd.addOption("--in-place");
|
||||||
cmd.addOption("%file");
|
cmd.addOption("%file");
|
||||||
return cmd;
|
return cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringAspect command;
|
FilePathAspect command;
|
||||||
BoolAspect autoFormatOnSave;
|
BoolAspect autoFormatOnSave;
|
||||||
BoolAspect autoFormatOnlyCurrentProject;
|
BoolAspect autoFormatOnlyCurrentProject;
|
||||||
StringAspect autoFormatMime;
|
StringAspect autoFormatMime;
|
||||||
|
@@ -678,7 +678,7 @@ QVariant CMakeGeneratorKitAspect::defaultValue(const Kit *k) const
|
|||||||
if (it != known.constEnd()) {
|
if (it != known.constEnd()) {
|
||||||
const bool hasNinja = [k, tool] {
|
const bool hasNinja = [k, tool] {
|
||||||
auto settings = Internal::CMakeSpecificSettings::instance();
|
auto settings = Internal::CMakeSpecificSettings::instance();
|
||||||
if (settings->ninjaPath.filePath().isEmpty()) {
|
if (settings->ninjaPath().isEmpty()) {
|
||||||
auto findNinja = [](const Environment &env) -> bool {
|
auto findNinja = [](const Environment &env) -> bool {
|
||||||
return !env.searchInPath("ninja").isEmpty();
|
return !env.searchInPath("ninja").isEmpty();
|
||||||
};
|
};
|
||||||
|
@@ -32,9 +32,9 @@ CMakeSpecificSettings::CMakeSpecificSettings()
|
|||||||
setCategory(Constants::Settings::CATEGORY);
|
setCategory(Constants::Settings::CATEGORY);
|
||||||
setCategoryIconPath(Constants::Icons::SETTINGS_CATEGORY);
|
setCategoryIconPath(Constants::Icons::SETTINGS_CATEGORY);
|
||||||
|
|
||||||
setLayouter([this](QWidget *widget) {
|
setLayouter([this] {
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
Column {
|
return Column {
|
||||||
autorunCMake,
|
autorunCMake,
|
||||||
packageManagerAutoSetup,
|
packageManagerAutoSetup,
|
||||||
askBeforeReConfigureInitialParams,
|
askBeforeReConfigureInitialParams,
|
||||||
@@ -42,7 +42,7 @@ CMakeSpecificSettings::CMakeSpecificSettings()
|
|||||||
showSourceSubFolders,
|
showSourceSubFolders,
|
||||||
showAdvancedOptionsByDefault,
|
showAdvancedOptionsByDefault,
|
||||||
st
|
st
|
||||||
}.attachTo(widget);
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: fixup of QTCREATORBUG-26289 , remove in Qt Creator 7 or so
|
// TODO: fixup of QTCREATORBUG-26289 , remove in Qt Creator 7 or so
|
||||||
|
@@ -15,7 +15,7 @@ public:
|
|||||||
static CMakeSpecificSettings *instance();
|
static CMakeSpecificSettings *instance();
|
||||||
|
|
||||||
Utils::BoolAspect autorunCMake;
|
Utils::BoolAspect autorunCMake;
|
||||||
Utils::StringAspect ninjaPath;
|
Utils::FilePathAspect ninjaPath;
|
||||||
Utils::BoolAspect packageManagerAutoSetup;
|
Utils::BoolAspect packageManagerAutoSetup;
|
||||||
Utils::BoolAspect askBeforeReConfigureInitialParams;
|
Utils::BoolAspect askBeforeReConfigureInitialParams;
|
||||||
Utils::BoolAspect askBeforePresetsReload;
|
Utils::BoolAspect askBeforePresetsReload;
|
||||||
|
@@ -36,7 +36,6 @@ CppcheckOptions::CppcheckOptions()
|
|||||||
|
|
||||||
registerAspect(&binary);
|
registerAspect(&binary);
|
||||||
binary.setSettingsKey("binary");
|
binary.setSettingsKey("binary");
|
||||||
binary.setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
||||||
binary.setExpectedKind(PathChooser::ExistingCommand);
|
binary.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
binary.setCommandVersionArguments({"--version"});
|
binary.setCommandVersionArguments({"--version"});
|
||||||
binary.setLabelText(Tr::tr("Binary:"));
|
binary.setLabelText(Tr::tr("Binary:"));
|
||||||
|
@@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
std::function<void(QWidget *widget)> layouter();
|
std::function<void(QWidget *widget)> layouter();
|
||||||
|
|
||||||
Utils::StringAspect binary;
|
Utils::FilePathAspect binary;
|
||||||
Utils::BoolAspect warning;
|
Utils::BoolAspect warning;
|
||||||
Utils::BoolAspect style;
|
Utils::BoolAspect style;
|
||||||
Utils::BoolAspect performance;
|
Utils::BoolAspect performance;
|
||||||
|
@@ -100,7 +100,7 @@ void CppcheckTool::updateArguments()
|
|||||||
|
|
||||||
arguments.push_back("--template=\"{file},{line},{severity},{id},{message}\"");
|
arguments.push_back("--template=\"{file},{line},{severity},{id},{message}\"");
|
||||||
|
|
||||||
m_runner->reconfigure(m_options.binary.filePath(), arguments.join(' '));
|
m_runner->reconfigure(m_options.binary(), arguments.join(' '));
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CppcheckTool::additionalArguments(const CppEditor::ProjectPart &part) const
|
QStringList CppcheckTool::additionalArguments(const CppEditor::ProjectPart &part) const
|
||||||
|
@@ -103,7 +103,7 @@ std::optional<bool> DockerApi::isDockerDaemonAvailable(bool async)
|
|||||||
|
|
||||||
FilePath DockerApi::dockerClient()
|
FilePath DockerApi::dockerClient()
|
||||||
{
|
{
|
||||||
return FilePath::fromString(m_settings->dockerBinaryPath.value());
|
return m_settings->dockerBinaryPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Docker::Internal
|
} // Docker::Internal
|
||||||
|
@@ -99,7 +99,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void setupShellProcess(Process *shellProcess) final
|
void setupShellProcess(Process *shellProcess) final
|
||||||
{
|
{
|
||||||
shellProcess->setCommand({m_settings->dockerBinaryPath.filePath(),
|
shellProcess->setCommand({m_settings->dockerBinaryPath(),
|
||||||
{"container", "start", "-i", "-a", m_containerId}});
|
{"container", "start", "-i", "-a", m_containerId}});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,7 +498,7 @@ CommandLine DockerDevicePrivate::withDockerExecCmd(const CommandLine &cmd,
|
|||||||
if (!updateContainerAccess())
|
if (!updateContainerAccess())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
CommandLine dockerCmd{m_settings->dockerBinaryPath.filePath(), {"exec"}};
|
CommandLine dockerCmd{m_settings->dockerBinaryPath(), {"exec"}};
|
||||||
|
|
||||||
if (interactive)
|
if (interactive)
|
||||||
dockerCmd.addArg("-i");
|
dockerCmd.addArg("-i");
|
||||||
@@ -555,7 +555,7 @@ void DockerDevicePrivate::stopCurrentContainer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Process proc;
|
Process proc;
|
||||||
proc.setCommand({m_settings->dockerBinaryPath.filePath(), {"container", "stop", m_container}});
|
proc.setCommand({m_settings->dockerBinaryPath(), {"container", "stop", m_container}});
|
||||||
|
|
||||||
m_container.clear();
|
m_container.clear();
|
||||||
|
|
||||||
@@ -660,7 +660,7 @@ bool DockerDevicePrivate::isImageAvailable() const
|
|||||||
{
|
{
|
||||||
Process proc;
|
Process proc;
|
||||||
proc.setCommand(
|
proc.setCommand(
|
||||||
{m_settings->dockerBinaryPath.filePath(),
|
{m_settings->dockerBinaryPath(),
|
||||||
{"image", "list", m_data.repoAndTag(), "--format", "{{.Repository}}:{{.Tag}}"}});
|
{"image", "list", m_data.repoAndTag(), "--format", "{{.Repository}}:{{.Tag}}"}});
|
||||||
proc.runBlocking();
|
proc.runBlocking();
|
||||||
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
if (proc.result() != ProcessResult::FinishedWithSuccess)
|
||||||
@@ -682,7 +682,7 @@ bool DockerDevicePrivate::createContainer()
|
|||||||
|
|
||||||
const QString display = HostOsInfo::isLinuxHost() ? QString(":0")
|
const QString display = HostOsInfo::isLinuxHost() ? QString(":0")
|
||||||
: QString("host.docker.internal:0");
|
: QString("host.docker.internal:0");
|
||||||
CommandLine dockerCreate{m_settings->dockerBinaryPath.filePath(),
|
CommandLine dockerCreate{m_settings->dockerBinaryPath(),
|
||||||
{"create",
|
{"create",
|
||||||
"-i",
|
"-i",
|
||||||
"--rm",
|
"--rm",
|
||||||
@@ -1053,7 +1053,7 @@ public:
|
|||||||
connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
m_buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
|
m_buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
|
|
||||||
CommandLine cmd{m_settings->dockerBinaryPath.filePath(),
|
CommandLine cmd{m_settings->dockerBinaryPath(),
|
||||||
{"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}};
|
{"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}};
|
||||||
m_log->append(Tr::tr("Running \"%1\"\n").arg(cmd.toUserOutput()));
|
m_log->append(Tr::tr("Running \"%1\"\n").arg(cmd.toUserOutput()));
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
|
||||||
#include <utils/filepath.h>
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
@@ -23,17 +22,16 @@ DockerSettings::DockerSettings()
|
|||||||
setDisplayName(Tr::tr("Docker"));
|
setDisplayName(Tr::tr("Docker"));
|
||||||
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
||||||
|
|
||||||
setLayouter([this](QWidget *widget) {
|
setLayouter([this] {
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
Column {
|
return Column {
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Configuration")),
|
title(Tr::tr("Configuration")),
|
||||||
Row { dockerBinaryPath }
|
Row { dockerBinaryPath }
|
||||||
},
|
},
|
||||||
st
|
st
|
||||||
}.attachTo(widget);
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -44,7 +42,6 @@ DockerSettings::DockerSettings()
|
|||||||
additionalPaths.append("/usr/local/bin");
|
additionalPaths.append("/usr/local/bin");
|
||||||
|
|
||||||
registerAspect(&dockerBinaryPath);
|
registerAspect(&dockerBinaryPath);
|
||||||
dockerBinaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
||||||
dockerBinaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
dockerBinaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
dockerBinaryPath.setDefaultFilePath(
|
dockerBinaryPath.setDefaultFilePath(
|
||||||
FilePath::fromString("docker").searchInPath(additionalPaths));
|
FilePath::fromString("docker").searchInPath(additionalPaths));
|
||||||
|
@@ -12,7 +12,7 @@ class DockerSettings final : public Core::PagedSettings
|
|||||||
public:
|
public:
|
||||||
DockerSettings();
|
DockerSettings();
|
||||||
|
|
||||||
Utils::StringAspect dockerBinaryPath;
|
Utils::FilePathAspect dockerBinaryPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Docker::Internal
|
} // Docker::Internal
|
||||||
|
@@ -232,7 +232,7 @@ FossilClient::FossilClient()
|
|||||||
|
|
||||||
unsigned int FossilClient::synchronousBinaryVersion() const
|
unsigned int FossilClient::synchronousBinaryVersion() const
|
||||||
{
|
{
|
||||||
if (settings().binaryPath.value().isEmpty())
|
if (settings().binaryPath().isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const CommandResult result = vcsSynchronousExec({}, QStringList{"version"});
|
const CommandResult result = vcsSynchronousExec({}, QStringList{"version"});
|
||||||
|
@@ -2422,7 +2422,7 @@ void GitClient::launchGitK(const FilePath &workingDirectory, const QString &file
|
|||||||
|
|
||||||
void GitClient::launchRepositoryBrowser(const FilePath &workingDirectory) const
|
void GitClient::launchRepositoryBrowser(const FilePath &workingDirectory) const
|
||||||
{
|
{
|
||||||
const FilePath repBrowserBinary = settings().repositoryBrowserCmd.filePath();
|
const FilePath repBrowserBinary = settings().repositoryBrowserCmd();
|
||||||
if (!repBrowserBinary.isEmpty())
|
if (!repBrowserBinary.isEmpty())
|
||||||
Process::startDetached({repBrowserBinary, {workingDirectory.toString()}}, workingDirectory);
|
Process::startDetached({repBrowserBinary, {workingDirectory.toString()}}, workingDirectory);
|
||||||
}
|
}
|
||||||
|
@@ -2001,7 +2001,7 @@ QObject *GitPlugin::remoteCommand(const QStringList &options, const QString &wor
|
|||||||
void GitPluginPrivate::updateRepositoryBrowserAction()
|
void GitPluginPrivate::updateRepositoryBrowserAction()
|
||||||
{
|
{
|
||||||
const bool repositoryEnabled = currentState().hasTopLevel();
|
const bool repositoryEnabled = currentState().hasTopLevel();
|
||||||
const bool hasRepositoryBrowserCmd = !settings().repositoryBrowserCmd.value().isEmpty();
|
const bool hasRepositoryBrowserCmd = !settings().repositoryBrowserCmd().isEmpty();
|
||||||
m_repositoryBrowserAction->setEnabled(repositoryEnabled && hasRepositoryBrowserCmd);
|
m_repositoryBrowserAction->setEnabled(repositoryEnabled && hasRepositoryBrowserCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,7 +94,6 @@ GitSettings::GitSettings()
|
|||||||
logDiff.setToolTip(Tr::tr("Note that huge amount of commits might take some time."));
|
logDiff.setToolTip(Tr::tr("Note that huge amount of commits might take some time."));
|
||||||
|
|
||||||
registerAspect(&repositoryBrowserCmd);
|
registerAspect(&repositoryBrowserCmd);
|
||||||
repositoryBrowserCmd.setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
||||||
repositoryBrowserCmd.setSettingsKey("RepositoryBrowserCmd");
|
repositoryBrowserCmd.setSettingsKey("RepositoryBrowserCmd");
|
||||||
repositoryBrowserCmd.setExpectedKind(PathChooser::ExistingCommand);
|
repositoryBrowserCmd.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
repositoryBrowserCmd.setHistoryCompleter("Git.RepoCommand.History");
|
repositoryBrowserCmd.setHistoryCompleter("Git.RepoCommand.History");
|
||||||
@@ -130,10 +129,9 @@ GitSettings::GitSettings()
|
|||||||
|
|
||||||
timeout.setDefaultValue(Utils::HostOsInfo::isWindowsHost() ? 60 : 30);
|
timeout.setDefaultValue(Utils::HostOsInfo::isWindowsHost() ? 60 : 30);
|
||||||
|
|
||||||
setLayouter([this](QWidget *widget) {
|
setLayouter([this] {
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
|
return Column {
|
||||||
Column {
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Configuration")),
|
title(Tr::tr("Configuration")),
|
||||||
Column {
|
Column {
|
||||||
@@ -166,7 +164,7 @@ GitSettings::GitSettings()
|
|||||||
},
|
},
|
||||||
|
|
||||||
st
|
st
|
||||||
}.attachTo(widget);
|
};
|
||||||
});
|
});
|
||||||
connect(&binaryPath, &StringAspect::valueChanged, this, [this] { tryResolve = true; });
|
connect(&binaryPath, &StringAspect::valueChanged, this, [this] { tryResolve = true; });
|
||||||
connect(&path, &StringAspect::valueChanged, this, [this] { tryResolve = true; });
|
connect(&path, &StringAspect::valueChanged, this, [this] { tryResolve = true; });
|
||||||
@@ -181,7 +179,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
|
|||||||
errorMessage->clear();
|
errorMessage->clear();
|
||||||
|
|
||||||
if (tryResolve) {
|
if (tryResolve) {
|
||||||
resolvedBinPath = binaryPath.filePath();
|
resolvedBinPath = binaryPath();
|
||||||
if (!resolvedBinPath.isAbsolutePath())
|
if (!resolvedBinPath.isAbsolutePath())
|
||||||
resolvedBinPath = resolvedBinPath.searchInPath({path.filePath()}, FilePath::PrependToPath);
|
resolvedBinPath = resolvedBinPath.searchInPath({path.filePath()}, FilePath::PrependToPath);
|
||||||
tryResolve = false;
|
tryResolve = false;
|
||||||
|
@@ -30,7 +30,7 @@ public:
|
|||||||
Utils::BoolAspect winSetHomeEnvironment;
|
Utils::BoolAspect winSetHomeEnvironment;
|
||||||
Utils::StringAspect gitkOptions;
|
Utils::StringAspect gitkOptions;
|
||||||
Utils::BoolAspect logDiff;
|
Utils::BoolAspect logDiff;
|
||||||
Utils::StringAspect repositoryBrowserCmd;
|
Utils::FilePathAspect repositoryBrowserCmd;
|
||||||
Utils::BoolAspect graphLog;
|
Utils::BoolAspect graphLog;
|
||||||
Utils::BoolAspect colorLog;
|
Utils::BoolAspect colorLog;
|
||||||
Utils::BoolAspect firstParent;
|
Utils::BoolAspect firstParent;
|
||||||
|
@@ -148,7 +148,7 @@ private:
|
|||||||
QPushButton *m_remove = nullptr;
|
QPushButton *m_remove = nullptr;
|
||||||
QPushButton *m_add = nullptr;
|
QPushButton *m_add = nullptr;
|
||||||
QComboBox *m_defaultGitLabServer = nullptr;
|
QComboBox *m_defaultGitLabServer = nullptr;
|
||||||
Utils::StringAspect m_curl;
|
FilePathAspect m_curl;
|
||||||
};
|
};
|
||||||
|
|
||||||
GitLabOptionsWidget::GitLabOptionsWidget(GitLabParameters *params)
|
GitLabOptionsWidget::GitLabOptionsWidget(GitLabParameters *params)
|
||||||
@@ -156,9 +156,8 @@ GitLabOptionsWidget::GitLabOptionsWidget(GitLabParameters *params)
|
|||||||
{
|
{
|
||||||
auto defaultLabel = new QLabel(Tr::tr("Default:"), this);
|
auto defaultLabel = new QLabel(Tr::tr("Default:"), this);
|
||||||
m_defaultGitLabServer = new QComboBox(this);
|
m_defaultGitLabServer = new QComboBox(this);
|
||||||
m_curl.setDisplayStyle(Utils::StringAspect::DisplayStyle::PathChooserDisplay);
|
|
||||||
m_curl.setLabelText(Tr::tr("curl:"));
|
m_curl.setLabelText(Tr::tr("curl:"));
|
||||||
m_curl.setExpectedKind(Utils::PathChooser::ExistingCommand);
|
m_curl.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
|
|
||||||
m_gitLabServerWidget = new GitLabServerWidget(GitLabServerWidget::Display, this);
|
m_gitLabServerWidget = new GitLabServerWidget(GitLabServerWidget::Display, this);
|
||||||
|
|
||||||
@@ -208,7 +207,7 @@ GitLabOptionsWidget::GitLabOptionsWidget(GitLabParameters *params)
|
|||||||
result.gitLabServers.append(m_defaultGitLabServer->itemData(i).value<GitLabServer>());
|
result.gitLabServers.append(m_defaultGitLabServer->itemData(i).value<GitLabServer>());
|
||||||
if (m_defaultGitLabServer->count())
|
if (m_defaultGitLabServer->count())
|
||||||
result.defaultGitLabServer = m_defaultGitLabServer->currentData().value<GitLabServer>().id;
|
result.defaultGitLabServer = m_defaultGitLabServer->currentData().value<GitLabServer>().id;
|
||||||
result.curl = m_curl.filePath();
|
result.curl = m_curl();
|
||||||
|
|
||||||
if (result != *m_parameters) {
|
if (result != *m_parameters) {
|
||||||
m_parameters->assign(result);
|
m_parameters->assign(result);
|
||||||
|
@@ -46,7 +46,7 @@ void HaskellManager::openGhci(const FilePath &haskellFile)
|
|||||||
+ (isHaskell ? QStringList{haskellFile.fileName()} : QStringList());
|
+ (isHaskell ? QStringList{haskellFile.fileName()} : QStringList());
|
||||||
Process p;
|
Process p;
|
||||||
p.setTerminalMode(TerminalMode::Detached);
|
p.setTerminalMode(TerminalMode::Detached);
|
||||||
p.setCommand({settings().stackPath.filePath(), args});
|
p.setCommand({settings().stackPath(), args});
|
||||||
p.setWorkingDirectory(haskellFile.absolutePath());
|
p.setWorkingDirectory(haskellFile.absolutePath());
|
||||||
p.start();
|
p.start();
|
||||||
}
|
}
|
||||||
|
@@ -68,7 +68,7 @@ Runnable HaskellRunConfiguration::runnable() const
|
|||||||
|
|
||||||
r.workingDirectory = projectDirectory;
|
r.workingDirectory = projectDirectory;
|
||||||
r.environment = aspect<LocalEnvironmentAspect>()->environment();
|
r.environment = aspect<LocalEnvironmentAspect>()->environment();
|
||||||
r.command = {r.environment.searchInPath(settings().stackPath()), args};
|
r.command = {r.environment.searchInPath(settings().stackPath().path()), args};
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,10 +6,7 @@
|
|||||||
#include "haskellconstants.h"
|
#include "haskellconstants.h"
|
||||||
#include "haskelltr.h"
|
#include "haskelltr.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/pathchooser.h>
|
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -46,18 +43,18 @@ HaskellSettings::HaskellSettings()
|
|||||||
? FilePath::fromString("/usr/local/bin/stack")
|
? FilePath::fromString("/usr/local/bin/stack")
|
||||||
: FilePath::fromString("stack"));
|
: FilePath::fromString("stack"));
|
||||||
|
|
||||||
setLayouter([this](QWidget *widget) {
|
setLayouter([this] {
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
Column {
|
return Column {
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("General")),
|
title(Tr::tr("General")),
|
||||||
Row { Tr::tr("Stack executable:"), stackPath }
|
Row { Tr::tr("Stack executable:"), stackPath }
|
||||||
},
|
},
|
||||||
st,
|
st,
|
||||||
}.attachTo(widget);
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
readSettings(Core::ICore::settings());
|
readSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Haskell::Internal
|
} // Haskell::Internal
|
||||||
|
@@ -12,7 +12,7 @@ class HaskellSettings : public Core::PagedSettings
|
|||||||
public:
|
public:
|
||||||
HaskellSettings();
|
HaskellSettings();
|
||||||
|
|
||||||
Utils::StringAspect stackPath;
|
Utils::FilePathAspect stackPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
HaskellSettings &settings();
|
HaskellSettings &settings();
|
||||||
|
@@ -38,7 +38,7 @@ bool StackBuildStep::init()
|
|||||||
if (AbstractProcessStep::init()) {
|
if (AbstractProcessStep::init()) {
|
||||||
const auto projectDir = QDir(project()->projectDirectory().toString());
|
const auto projectDir = QDir(project()->projectDirectory().toString());
|
||||||
processParameters()->setCommandLine(
|
processParameters()->setCommandLine(
|
||||||
{settings().stackPath.filePath(),
|
{settings().stackPath(),
|
||||||
{"build", "--work-dir", projectDir.relativeFilePath(buildDirectory().toString())}});
|
{"build", "--work-dir", projectDir.relativeFilePath(buildDirectory().toString())}});
|
||||||
processParameters()->setEnvironment(buildEnvironment());
|
processParameters()->setEnvironment(buildEnvironment());
|
||||||
}
|
}
|
||||||
|
@@ -783,7 +783,7 @@ VcsCommand *MercurialPluginPrivate::createInitialCheckoutCommand(const QString &
|
|||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("clone") << extraArgs << url << localName;
|
args << QLatin1String("clone") << extraArgs << url << localName;
|
||||||
auto command = VcsBaseClient::createVcsCommand(baseDirectory, m_client.processEnvironment());
|
auto command = VcsBaseClient::createVcsCommand(baseDirectory, m_client.processEnvironment());
|
||||||
command->addJob({settings().binaryPath.filePath(), args}, -1);
|
command->addJob({settings().binaryPath(), args}, -1);
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -863,7 +863,7 @@ void SubversionPluginPrivate::vcsAnnotateHelper(const FilePath &workingDir, cons
|
|||||||
const FilePath source = VcsBaseEditor::getSource(workingDir, file);
|
const FilePath source = VcsBaseEditor::getSource(workingDir, file);
|
||||||
QTextCodec *codec = VcsBaseEditor::getCodec(source);
|
QTextCodec *codec = VcsBaseEditor::getCodec(source);
|
||||||
|
|
||||||
CommandLine args{settings().binaryPath.filePath(), {"annotate"}};
|
CommandLine args{settings().binaryPath(), {"annotate"}};
|
||||||
args << SubversionClient::AddAuthOptions();
|
args << SubversionClient::AddAuthOptions();
|
||||||
if (settings().spaceIgnorantAnnotation.value())
|
if (settings().spaceIgnorantAnnotation.value())
|
||||||
args << "-x" << "-uw";
|
args << "-x" << "-uw";
|
||||||
@@ -1006,7 +1006,7 @@ QString SubversionPluginPrivate::synchronousTopic(const FilePath &repository) co
|
|||||||
bool SubversionPluginPrivate::vcsAdd(const FilePath &workingDir, const QString &rawFileName)
|
bool SubversionPluginPrivate::vcsAdd(const FilePath &workingDir, const QString &rawFileName)
|
||||||
{
|
{
|
||||||
const QString file = QDir::toNativeSeparators(SubversionClient::escapeFile(rawFileName));
|
const QString file = QDir::toNativeSeparators(SubversionClient::escapeFile(rawFileName));
|
||||||
CommandLine args{settings().binaryPath.filePath()};
|
CommandLine args{settings().binaryPath()};
|
||||||
args << "add" << SubversionClient::AddAuthOptions() << "--parents" << file;
|
args << "add" << SubversionClient::AddAuthOptions() << "--parents" << file;
|
||||||
return runSvn(workingDir, args, RunFlags::ShowStdOut).result()
|
return runSvn(workingDir, args, RunFlags::ShowStdOut).result()
|
||||||
== ProcessResult::FinishedWithSuccess;
|
== ProcessResult::FinishedWithSuccess;
|
||||||
@@ -1016,7 +1016,7 @@ bool SubversionPluginPrivate::vcsDelete(const FilePath &workingDir, const QStrin
|
|||||||
{
|
{
|
||||||
const QString file = QDir::toNativeSeparators(SubversionClient::escapeFile(rawFileName));
|
const QString file = QDir::toNativeSeparators(SubversionClient::escapeFile(rawFileName));
|
||||||
|
|
||||||
CommandLine args{settings().binaryPath.filePath()};
|
CommandLine args{settings().binaryPath()};
|
||||||
args << "delete" << SubversionClient::AddAuthOptions() << "--force" << file;
|
args << "delete" << SubversionClient::AddAuthOptions() << "--force" << file;
|
||||||
|
|
||||||
return runSvn(workingDir, args, RunFlags::ShowStdOut).result()
|
return runSvn(workingDir, args, RunFlags::ShowStdOut).result()
|
||||||
@@ -1025,7 +1025,7 @@ bool SubversionPluginPrivate::vcsDelete(const FilePath &workingDir, const QStrin
|
|||||||
|
|
||||||
bool SubversionPluginPrivate::vcsMove(const FilePath &workingDir, const QString &from, const QString &to)
|
bool SubversionPluginPrivate::vcsMove(const FilePath &workingDir, const QString &from, const QString &to)
|
||||||
{
|
{
|
||||||
CommandLine args{settings().binaryPath.filePath(), {"move"}};
|
CommandLine args{settings().binaryPath(), {"move"}};
|
||||||
args << SubversionClient::AddAuthOptions()
|
args << SubversionClient::AddAuthOptions()
|
||||||
<< QDir::toNativeSeparators(SubversionClient::escapeFile(from))
|
<< QDir::toNativeSeparators(SubversionClient::escapeFile(from))
|
||||||
<< QDir::toNativeSeparators(SubversionClient::escapeFile(to));
|
<< QDir::toNativeSeparators(SubversionClient::escapeFile(to));
|
||||||
@@ -1038,7 +1038,7 @@ bool SubversionPluginPrivate::vcsCheckout(const FilePath &directory, const QByte
|
|||||||
QUrl tempUrl = QUrl::fromEncoded(url);
|
QUrl tempUrl = QUrl::fromEncoded(url);
|
||||||
const QString username = tempUrl.userName();
|
const QString username = tempUrl.userName();
|
||||||
const QString password = tempUrl.password();
|
const QString password = tempUrl.password();
|
||||||
CommandLine args{settings().binaryPath.filePath(), {"checkout"}};
|
CommandLine args{settings().binaryPath(), {"checkout"}};
|
||||||
args << Constants::NON_INTERACTIVE_OPTION;
|
args << Constants::NON_INTERACTIVE_OPTION;
|
||||||
|
|
||||||
if (!username.isEmpty()) {
|
if (!username.isEmpty()) {
|
||||||
@@ -1085,7 +1085,7 @@ bool SubversionPluginPrivate::managesDirectory(const FilePath &directory, FilePa
|
|||||||
|
|
||||||
bool SubversionPluginPrivate::managesFile(const FilePath &workingDirectory, const QString &fileName) const
|
bool SubversionPluginPrivate::managesFile(const FilePath &workingDirectory, const QString &fileName) const
|
||||||
{
|
{
|
||||||
CommandLine args{settings().binaryPath.filePath()};
|
CommandLine args{settings().binaryPath()};
|
||||||
args << "status" << SubversionClient::AddAuthOptions()
|
args << "status" << SubversionClient::AddAuthOptions()
|
||||||
<< QDir::toNativeSeparators(SubversionClient::escapeFile(fileName));
|
<< QDir::toNativeSeparators(SubversionClient::escapeFile(fileName));
|
||||||
const QString output = runSvn(workingDirectory, args).cleanedStdOut();
|
const QString output = runSvn(workingDirectory, args).cleanedStdOut();
|
||||||
@@ -1124,7 +1124,7 @@ bool SubversionPluginPrivate::isVcsFileOrDirectory(const FilePath &filePath) con
|
|||||||
|
|
||||||
bool SubversionPluginPrivate::isConfigured() const
|
bool SubversionPluginPrivate::isConfigured() const
|
||||||
{
|
{
|
||||||
const FilePath binary = settings().binaryPath.filePath();
|
const FilePath binary = settings().binaryPath();
|
||||||
if (binary.isEmpty())
|
if (binary.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
QFileInfo fi = binary.toFileInfo();
|
QFileInfo fi = binary.toFileInfo();
|
||||||
@@ -1187,7 +1187,7 @@ VcsCommand *SubversionPluginPrivate::createInitialCheckoutCommand(const QString
|
|||||||
const QString &localName,
|
const QString &localName,
|
||||||
const QStringList &extraArgs)
|
const QStringList &extraArgs)
|
||||||
{
|
{
|
||||||
CommandLine args{settings().binaryPath.filePath()};
|
CommandLine args{settings().binaryPath()};
|
||||||
args << "checkout";
|
args << "checkout";
|
||||||
args << SubversionClient::AddAuthOptions();
|
args << SubversionClient::AddAuthOptions();
|
||||||
args << Subversion::Constants::NON_INTERACTIVE_OPTION << extraArgs << url << localName;
|
args << Subversion::Constants::NON_INTERACTIVE_OPTION << extraArgs << url << localName;
|
||||||
|
Reference in New Issue
Block a user