forked from qt-creator/qt-creator
Vcs: Code cosmetics
Drop some Utils:: and rely on some aspects' operator()() Change-Id: I40d2c2973c1c9eff443bb74b8da44e0824d8d5c6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -433,7 +433,7 @@ RepositorySettings FossilClient::synchronousSettingsQuery(const FilePath &workin
|
|||||||
RepositorySettings repoSettings;
|
RepositorySettings repoSettings;
|
||||||
repoSettings.user = synchronousUserDefaultQuery(workingDirectory);
|
repoSettings.user = synchronousUserDefaultQuery(workingDirectory);
|
||||||
if (repoSettings.user.isEmpty())
|
if (repoSettings.user.isEmpty())
|
||||||
repoSettings.user = settings().userName.value();
|
repoSettings.user = settings().userName();
|
||||||
|
|
||||||
for (const QString &line : output.split('\n', Qt::SkipEmptyParts)) {
|
for (const QString &line : output.split('\n', Qt::SkipEmptyParts)) {
|
||||||
// parse settings line:
|
// parse settings line:
|
||||||
@@ -587,7 +587,7 @@ bool FossilClient::synchronousCreateRepository(const FilePath &workingDirectory,
|
|||||||
|
|
||||||
const QString repoName = workingDirectory.fileName().simplified();
|
const QString repoName = workingDirectory.fileName().simplified();
|
||||||
const FilePath repoPath = settings().defaultRepoPath();
|
const FilePath repoPath = settings().defaultRepoPath();
|
||||||
const QString adminUser = settings().userName.value();
|
const QString adminUser = settings().userName();
|
||||||
|
|
||||||
if (repoName.isEmpty() || repoPath.isEmpty())
|
if (repoName.isEmpty() || repoPath.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
@@ -50,7 +50,7 @@ QString FossilJsExtension::defaultAdminUser() const
|
|||||||
if (!isConfigured())
|
if (!isConfigured())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
return settings().userName.value();
|
return settings().userName();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FossilJsExtension::defaultSslIdentityFile() const
|
QString FossilJsExtension::defaultSslIdentityFile() const
|
||||||
@@ -74,7 +74,7 @@ bool FossilJsExtension::defaultDisableAutosync() const
|
|||||||
if (!isConfigured())
|
if (!isConfigured())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return settings().disableAutosync.value();
|
return settings().disableAutosync();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -115,7 +115,7 @@ BranchView::BranchView()
|
|||||||
connect(m_includeOldEntriesAction, &QAction::toggled,
|
connect(m_includeOldEntriesAction, &QAction::toggled,
|
||||||
this, &BranchView::setIncludeOldEntries);
|
this, &BranchView::setIncludeOldEntries);
|
||||||
m_includeTagsAction->setCheckable(true);
|
m_includeTagsAction->setCheckable(true);
|
||||||
m_includeTagsAction->setChecked(settings().showTags.value());
|
m_includeTagsAction->setChecked(settings().showTags());
|
||||||
connect(m_includeTagsAction, &QAction::toggled,
|
connect(m_includeTagsAction, &QAction::toggled,
|
||||||
this, &BranchView::setIncludeTags);
|
this, &BranchView::setIncludeTags);
|
||||||
|
|
||||||
|
@@ -2110,7 +2110,7 @@ Environment GitClient::processEnvironment() const
|
|||||||
Environment environment = VcsBaseClientImpl::processEnvironment();
|
Environment environment = VcsBaseClientImpl::processEnvironment();
|
||||||
const FilePath gitPath = settings().path();
|
const FilePath gitPath = settings().path();
|
||||||
environment.prependOrSetPath(gitPath);
|
environment.prependOrSetPath(gitPath);
|
||||||
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value()) {
|
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment()) {
|
||||||
QString homePath;
|
QString homePath;
|
||||||
if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) {
|
if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) {
|
||||||
homePath = QDir::toNativeSeparators(QDir::homePath());
|
homePath = QDir::toNativeSeparators(QDir::homePath());
|
||||||
@@ -2448,7 +2448,7 @@ void GitClient::tryLaunchingGitK(const Environment &env,
|
|||||||
binary = wish;
|
binary = wish;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const QString gitkOpts = settings().gitkOptions.value();
|
const QString gitkOpts = settings().gitkOptions();
|
||||||
if (!gitkOpts.isEmpty())
|
if (!gitkOpts.isEmpty())
|
||||||
arguments.append(ProcessArgs::splitArgs(gitkOpts, HostOsInfo::hostOs()));
|
arguments.append(ProcessArgs::splitArgs(gitkOpts, HostOsInfo::hostOs()));
|
||||||
if (!fileName.isEmpty())
|
if (!fileName.isEmpty())
|
||||||
|
@@ -132,7 +132,7 @@ static QString sanitizeBlameOutput(const QString &b)
|
|||||||
if (b.isEmpty())
|
if (b.isEmpty())
|
||||||
return b;
|
return b;
|
||||||
|
|
||||||
const bool omitDate = settings().omitAnnotationDate.value();
|
const bool omitDate = settings().omitAnnotationDate();
|
||||||
const QChar space(' ');
|
const QChar space(' ');
|
||||||
const int parenPos = b.indexOf(')');
|
const int parenPos = b.indexOf(')');
|
||||||
if (parenPos == -1)
|
if (parenPos == -1)
|
||||||
|
@@ -1437,7 +1437,7 @@ void GitPluginPrivate::setupInstantBlame()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!settings().instantBlame.value()) {
|
if (!settings().instantBlame()) {
|
||||||
m_lastVisitedEditorLine = -1;
|
m_lastVisitedEditorLine = -1;
|
||||||
stopInstantBlame();
|
stopInstantBlame();
|
||||||
return;
|
return;
|
||||||
@@ -1456,7 +1456,7 @@ void GitPluginPrivate::setupInstantBlame()
|
|||||||
|
|
||||||
m_blameCursorPosConn = connect(widget, &QPlainTextEdit::cursorPositionChanged, this,
|
m_blameCursorPosConn = connect(widget, &QPlainTextEdit::cursorPositionChanged, this,
|
||||||
[this] {
|
[this] {
|
||||||
if (!settings().instantBlame.value()) {
|
if (!settings().instantBlame()) {
|
||||||
disconnect(m_blameCursorPosConn);
|
disconnect(m_blameCursorPosConn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1515,7 +1515,7 @@ CommitInfo parseBlameOutput(const QStringList &blame, const Utils::FilePath &fil
|
|||||||
|
|
||||||
void GitPluginPrivate::instantBlameOnce()
|
void GitPluginPrivate::instantBlameOnce()
|
||||||
{
|
{
|
||||||
if (!settings().instantBlame.value()) {
|
if (!settings().instantBlame()) {
|
||||||
const TextEditorWidget *widget = TextEditorWidget::currentTextEditorWidget();
|
const TextEditorWidget *widget = TextEditorWidget::currentTextEditorWidget();
|
||||||
if (!widget)
|
if (!widget)
|
||||||
return;
|
return;
|
||||||
@@ -1725,7 +1725,7 @@ void GitPluginPrivate::pull()
|
|||||||
const VcsBasePluginState state = currentState();
|
const VcsBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasTopLevel(), return);
|
QTC_ASSERT(state.hasTopLevel(), return);
|
||||||
FilePath topLevel = state.topLevel();
|
FilePath topLevel = state.topLevel();
|
||||||
bool rebase = settings().pullRebase.value();
|
bool rebase = settings().pullRebase();
|
||||||
|
|
||||||
if (!rebase) {
|
if (!rebase) {
|
||||||
QString currentBranch = m_gitClient.synchronousCurrentLocalBranch(topLevel);
|
QString currentBranch = m_gitClient.synchronousCurrentLocalBranch(topLevel);
|
||||||
|
@@ -69,19 +69,19 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent)
|
|||||||
, m_mode(m)
|
, m_mode(m)
|
||||||
{
|
{
|
||||||
m_host.setLabelText(Tr::tr("Host:"));
|
m_host.setLabelText(Tr::tr("Host:"));
|
||||||
m_host.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay
|
m_host.setDisplayStyle(m == Display ? StringAspect::LabelDisplay
|
||||||
: Utils::StringAspect::LineEditDisplay);
|
: StringAspect::LineEditDisplay);
|
||||||
m_host.setValidationFunction([](Utils::FancyLineEdit *l, QString *) {
|
m_host.setValidationFunction([](FancyLineEdit *l, QString *) {
|
||||||
return hostValid(l->text());
|
return hostValid(l->text());
|
||||||
});
|
});
|
||||||
|
|
||||||
m_description.setLabelText(Tr::tr("Description:"));
|
m_description.setLabelText(Tr::tr("Description:"));
|
||||||
m_description.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay
|
m_description.setDisplayStyle(m == Display ? StringAspect::LabelDisplay
|
||||||
: Utils::StringAspect::LineEditDisplay);
|
: StringAspect::LineEditDisplay);
|
||||||
|
|
||||||
m_token.setLabelText(Tr::tr("Access token:"));
|
m_token.setLabelText(Tr::tr("Access token:"));
|
||||||
m_token.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay
|
m_token.setDisplayStyle(m == Display ? StringAspect::LabelDisplay
|
||||||
: Utils::StringAspect::LineEditDisplay);
|
: StringAspect::LineEditDisplay);
|
||||||
m_token.setVisible(m == Edit);
|
m_token.setVisible(m == Edit);
|
||||||
|
|
||||||
m_port.setLabelText(Tr::tr("Port:"));
|
m_port.setLabelText(Tr::tr("Port:"));
|
||||||
@@ -89,7 +89,7 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent)
|
|||||||
m_port.setValue(GitLabServer::defaultPort);
|
m_port.setValue(GitLabServer::defaultPort);
|
||||||
m_port.setEnabled(m == Edit);
|
m_port.setEnabled(m == Edit);
|
||||||
m_secure.setLabelText(Tr::tr("HTTPS:"));
|
m_secure.setLabelText(Tr::tr("HTTPS:"));
|
||||||
m_secure.setLabelPlacement(Utils::BoolAspect::LabelPlacement::InExtraLabel);
|
m_secure.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel);
|
||||||
m_secure.setDefaultValue(true);
|
m_secure.setDefaultValue(true);
|
||||||
m_secure.setEnabled(m == Edit);
|
m_secure.setEnabled(m == Edit);
|
||||||
|
|
||||||
@@ -110,12 +110,12 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent)
|
|||||||
GitLabServer GitLabServerWidget::gitLabServer() const
|
GitLabServer GitLabServerWidget::gitLabServer() const
|
||||||
{
|
{
|
||||||
GitLabServer result;
|
GitLabServer result;
|
||||||
result.id = m_mode == Edit ? Utils::Id::fromName(QUuid::createUuid().toByteArray()) : m_id;
|
result.id = m_mode == Edit ? Id::fromName(QUuid::createUuid().toByteArray()) : m_id;
|
||||||
result.host = m_host.value();
|
result.host = m_host();
|
||||||
result.description = m_description.value();
|
result.description = m_description();
|
||||||
result.token = m_token.value();
|
result.token = m_token();
|
||||||
result.port = m_port.value();
|
result.port = m_port();
|
||||||
result.secure = m_secure.value();
|
result.secure = m_secure();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1152,7 +1152,7 @@ bool PerforcePluginPrivate::vcsOpen(const FilePath &filePath)
|
|||||||
IVersionControl::SettingsFlags PerforcePluginPrivate::settingsFlags() const
|
IVersionControl::SettingsFlags PerforcePluginPrivate::settingsFlags() const
|
||||||
{
|
{
|
||||||
SettingsFlags rc;
|
SettingsFlags rc;
|
||||||
if (m_settings.autoOpen.value())
|
if (m_settings.autoOpen())
|
||||||
rc |= AutoOpen;
|
rc |= AutoOpen;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -1689,7 +1689,7 @@ void PerforcePluginPrivate::slotTopLevelFailed(const QString &errorMessage)
|
|||||||
void PerforcePluginPrivate::getTopLevel(const FilePath &workingDirectory, bool isSync)
|
void PerforcePluginPrivate::getTopLevel(const FilePath &workingDirectory, bool isSync)
|
||||||
{
|
{
|
||||||
// Run a new checker
|
// Run a new checker
|
||||||
if (m_settings.p4BinaryPath.value().isEmpty())
|
if (m_settings.p4BinaryPath().isEmpty())
|
||||||
return;
|
return;
|
||||||
auto checker = new PerforceChecker(dd);
|
auto checker = new PerforceChecker(dd);
|
||||||
connect(checker, &PerforceChecker::failed, dd, &PerforcePluginPrivate::slotTopLevelFailed);
|
connect(checker, &PerforceChecker::failed, dd, &PerforcePluginPrivate::slotTopLevelFailed);
|
||||||
|
@@ -149,13 +149,13 @@ PerforceSettings::~PerforceSettings()
|
|||||||
QStringList PerforceSettings::commonP4Arguments() const
|
QStringList PerforceSettings::commonP4Arguments() const
|
||||||
{
|
{
|
||||||
QStringList lst;
|
QStringList lst;
|
||||||
if (customEnv.value()) {
|
if (customEnv()) {
|
||||||
if (!p4Client.value().isEmpty())
|
if (!p4Client().isEmpty())
|
||||||
lst << "-c" << p4Client.value();
|
lst << "-c" << p4Client();
|
||||||
if (!p4Port.value().isEmpty())
|
if (!p4Port().isEmpty())
|
||||||
lst << "-p" << p4Port.value();
|
lst << "-p" << p4Port();
|
||||||
if (!p4User.value().isEmpty())
|
if (!p4User().isEmpty())
|
||||||
lst << "-u" << p4User.value();
|
lst << "-u" << p4User();
|
||||||
}
|
}
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ QStringList PerforceSettings::commonP4Arguments_volatile() const
|
|||||||
|
|
||||||
bool PerforceSettings::isValid() const
|
bool PerforceSettings::isValid() const
|
||||||
{
|
{
|
||||||
return !m_topLevel.isEmpty() && !p4BinaryPath.value().isEmpty();
|
return !m_topLevel.isEmpty() && !p4BinaryPath().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PerforceSettings::defaultEnv() const
|
bool PerforceSettings::defaultEnv() const
|
||||||
|
Reference in New Issue
Block a user