forked from qt-creator/qt-creator
Core: Use FilePaths in IVersionControl::additionalToolsPath()
Change-Id: I3c7d03b8695152f0830e809ce7a0709f48d8178b Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -83,9 +83,9 @@ QString IVersionControl::vcsMakeWritableText() const
|
||||
return QString();
|
||||
}
|
||||
|
||||
QStringList IVersionControl::additionalToolsPath() const
|
||||
FilePaths IVersionControl::additionalToolsPath() const
|
||||
{
|
||||
return QStringList();
|
||||
return {};
|
||||
}
|
||||
|
||||
ShellCommand *IVersionControl::createInitialCheckoutCommand(const QString &url,
|
||||
|
@@ -221,7 +221,7 @@ public:
|
||||
* Return a list of paths where tools that came with the VCS may be installed.
|
||||
* This is helpful on windows where e.g. git comes with a lot of nice unix tools.
|
||||
*/
|
||||
virtual QStringList additionalToolsPath() const;
|
||||
virtual Utils::FilePaths additionalToolsPath() const;
|
||||
|
||||
/*!
|
||||
* Return a ShellCommand capable of checking out \a url into \a baseDirectory, where
|
||||
|
@@ -326,7 +326,7 @@ void SystemSettingsWidget::resetFileBrowser()
|
||||
void SystemSettingsWidget::updatePath()
|
||||
{
|
||||
EnvironmentChange change;
|
||||
change.addAppendToPath(Utils::transform(VcsManager::additionalToolsPath(), &FilePath::fromString));
|
||||
change.addAppendToPath(VcsManager::additionalToolsPath());
|
||||
m_ui.patchChooser->setEnvironmentChange(change);
|
||||
}
|
||||
|
||||
|
@@ -136,7 +136,7 @@ public:
|
||||
QMap<QString, VcsInfo> m_cachedMatches;
|
||||
IVersionControl *m_unconfiguredVcs = nullptr;
|
||||
|
||||
QStringList m_cachedAdditionalToolsPaths;
|
||||
FilePaths m_cachedAdditionalToolsPaths;
|
||||
bool m_cachedAdditionalToolsPathsDirty = true;
|
||||
};
|
||||
|
||||
@@ -420,11 +420,11 @@ QString VcsManager::msgToAddToVcsFailed(const QStringList &files, const IVersion
|
||||
.arg(vc->displayName(), files.join(QString(QLatin1Char('\n'))));
|
||||
}
|
||||
|
||||
QStringList VcsManager::additionalToolsPath()
|
||||
FilePaths VcsManager::additionalToolsPath()
|
||||
{
|
||||
if (d->m_cachedAdditionalToolsPathsDirty) {
|
||||
d->m_cachedAdditionalToolsPaths.clear();
|
||||
foreach (IVersionControl *vc, versionControls())
|
||||
for (IVersionControl *vc : versionControls())
|
||||
d->m_cachedAdditionalToolsPaths.append(vc->additionalToolsPath());
|
||||
d->m_cachedAdditionalToolsPathsDirty = false;
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ public:
|
||||
* Return a list of paths where tools that came with the VCS may be installed.
|
||||
* This is helpful on windows where e.g. git comes with a lot of nice unix tools.
|
||||
*/
|
||||
static QStringList additionalToolsPath();
|
||||
static Utils::FilePaths additionalToolsPath();
|
||||
|
||||
static void clearVersionControlCache();
|
||||
|
||||
|
@@ -283,7 +283,7 @@ public:
|
||||
|
||||
RepoUrl getRepoUrl(const QString &location) const override;
|
||||
|
||||
QStringList additionalToolsPath() const final;
|
||||
Utils::FilePaths additionalToolsPath() const final;
|
||||
|
||||
bool isCommitEditorOpen() const;
|
||||
void startCommit(CommitType commitType = SimpleCommit);
|
||||
@@ -1934,10 +1934,10 @@ GitPluginPrivate::RepoUrl GitPluginPrivate::getRepoUrl(const QString &location)
|
||||
return GitRemote(location);
|
||||
}
|
||||
|
||||
QStringList GitPluginPrivate::additionalToolsPath() const
|
||||
FilePaths GitPluginPrivate::additionalToolsPath() const
|
||||
{
|
||||
QStringList res = m_gitClient.settings().searchPathList();
|
||||
const QString binaryPath = m_gitClient.gitBinDirectory().toString();
|
||||
FilePaths res = m_gitClient.settings().searchPathList();
|
||||
const FilePath binaryPath = m_gitClient.gitBinDirectory();
|
||||
if (!binaryPath.isEmpty() && !res.contains(binaryPath))
|
||||
res << binaryPath;
|
||||
return res;
|
||||
|
@@ -157,8 +157,7 @@ CommonSettingsWidget::CommonSettingsWidget(CommonOptionsPage *page)
|
||||
void CommonSettingsWidget::updatePath()
|
||||
{
|
||||
EnvironmentChange change;
|
||||
change.addAppendToPath(Utils::transform(Core::VcsManager::additionalToolsPath(),
|
||||
&FilePath::fromString));
|
||||
change.addAppendToPath(Core::VcsManager::additionalToolsPath());
|
||||
m_page->settings().sshPasswordPrompt.setEnvironmentChange(change);
|
||||
}
|
||||
|
||||
|
@@ -75,9 +75,10 @@ VcsBaseSettings::VcsBaseSettings()
|
||||
timeout.setSuffix(tr("s"));
|
||||
}
|
||||
|
||||
QStringList VcsBaseSettings::searchPathList() const
|
||||
FilePaths VcsBaseSettings::searchPathList() const
|
||||
{
|
||||
return path.value().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts);
|
||||
return Utils::transform(path.value().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts),
|
||||
&FilePath::fromUserInput);
|
||||
}
|
||||
|
||||
} // namespace VcsBase
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
Utils::IntegerAspect timeout; // Seconds
|
||||
Utils::StringAspect path;
|
||||
|
||||
QStringList searchPathList() const;
|
||||
Utils::FilePaths searchPathList() const;
|
||||
|
||||
private:
|
||||
QString m_settingsGroup;
|
||||
|
Reference in New Issue
Block a user