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();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList IVersionControl::additionalToolsPath() const
|
FilePaths IVersionControl::additionalToolsPath() const
|
||||||
{
|
{
|
||||||
return QStringList();
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
ShellCommand *IVersionControl::createInitialCheckoutCommand(const QString &url,
|
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.
|
* 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.
|
* 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
|
* Return a ShellCommand capable of checking out \a url into \a baseDirectory, where
|
||||||
|
@@ -326,7 +326,7 @@ void SystemSettingsWidget::resetFileBrowser()
|
|||||||
void SystemSettingsWidget::updatePath()
|
void SystemSettingsWidget::updatePath()
|
||||||
{
|
{
|
||||||
EnvironmentChange change;
|
EnvironmentChange change;
|
||||||
change.addAppendToPath(Utils::transform(VcsManager::additionalToolsPath(), &FilePath::fromString));
|
change.addAppendToPath(VcsManager::additionalToolsPath());
|
||||||
m_ui.patchChooser->setEnvironmentChange(change);
|
m_ui.patchChooser->setEnvironmentChange(change);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -136,7 +136,7 @@ public:
|
|||||||
QMap<QString, VcsInfo> m_cachedMatches;
|
QMap<QString, VcsInfo> m_cachedMatches;
|
||||||
IVersionControl *m_unconfiguredVcs = nullptr;
|
IVersionControl *m_unconfiguredVcs = nullptr;
|
||||||
|
|
||||||
QStringList m_cachedAdditionalToolsPaths;
|
FilePaths m_cachedAdditionalToolsPaths;
|
||||||
bool m_cachedAdditionalToolsPathsDirty = true;
|
bool m_cachedAdditionalToolsPathsDirty = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -420,11 +420,11 @@ QString VcsManager::msgToAddToVcsFailed(const QStringList &files, const IVersion
|
|||||||
.arg(vc->displayName(), files.join(QString(QLatin1Char('\n'))));
|
.arg(vc->displayName(), files.join(QString(QLatin1Char('\n'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList VcsManager::additionalToolsPath()
|
FilePaths VcsManager::additionalToolsPath()
|
||||||
{
|
{
|
||||||
if (d->m_cachedAdditionalToolsPathsDirty) {
|
if (d->m_cachedAdditionalToolsPathsDirty) {
|
||||||
d->m_cachedAdditionalToolsPaths.clear();
|
d->m_cachedAdditionalToolsPaths.clear();
|
||||||
foreach (IVersionControl *vc, versionControls())
|
for (IVersionControl *vc : versionControls())
|
||||||
d->m_cachedAdditionalToolsPaths.append(vc->additionalToolsPath());
|
d->m_cachedAdditionalToolsPaths.append(vc->additionalToolsPath());
|
||||||
d->m_cachedAdditionalToolsPathsDirty = false;
|
d->m_cachedAdditionalToolsPathsDirty = false;
|
||||||
}
|
}
|
||||||
|
@@ -94,7 +94,7 @@ public:
|
|||||||
* Return a list of paths where tools that came with the VCS may be installed.
|
* 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.
|
* 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();
|
static void clearVersionControlCache();
|
||||||
|
|
||||||
|
@@ -283,7 +283,7 @@ public:
|
|||||||
|
|
||||||
RepoUrl getRepoUrl(const QString &location) const override;
|
RepoUrl getRepoUrl(const QString &location) const override;
|
||||||
|
|
||||||
QStringList additionalToolsPath() const final;
|
Utils::FilePaths additionalToolsPath() const final;
|
||||||
|
|
||||||
bool isCommitEditorOpen() const;
|
bool isCommitEditorOpen() const;
|
||||||
void startCommit(CommitType commitType = SimpleCommit);
|
void startCommit(CommitType commitType = SimpleCommit);
|
||||||
@@ -1934,10 +1934,10 @@ GitPluginPrivate::RepoUrl GitPluginPrivate::getRepoUrl(const QString &location)
|
|||||||
return GitRemote(location);
|
return GitRemote(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList GitPluginPrivate::additionalToolsPath() const
|
FilePaths GitPluginPrivate::additionalToolsPath() const
|
||||||
{
|
{
|
||||||
QStringList res = m_gitClient.settings().searchPathList();
|
FilePaths res = m_gitClient.settings().searchPathList();
|
||||||
const QString binaryPath = m_gitClient.gitBinDirectory().toString();
|
const FilePath binaryPath = m_gitClient.gitBinDirectory();
|
||||||
if (!binaryPath.isEmpty() && !res.contains(binaryPath))
|
if (!binaryPath.isEmpty() && !res.contains(binaryPath))
|
||||||
res << binaryPath;
|
res << binaryPath;
|
||||||
return res;
|
return res;
|
||||||
|
@@ -157,8 +157,7 @@ CommonSettingsWidget::CommonSettingsWidget(CommonOptionsPage *page)
|
|||||||
void CommonSettingsWidget::updatePath()
|
void CommonSettingsWidget::updatePath()
|
||||||
{
|
{
|
||||||
EnvironmentChange change;
|
EnvironmentChange change;
|
||||||
change.addAppendToPath(Utils::transform(Core::VcsManager::additionalToolsPath(),
|
change.addAppendToPath(Core::VcsManager::additionalToolsPath());
|
||||||
&FilePath::fromString));
|
|
||||||
m_page->settings().sshPasswordPrompt.setEnvironmentChange(change);
|
m_page->settings().sshPasswordPrompt.setEnvironmentChange(change);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,9 +75,10 @@ VcsBaseSettings::VcsBaseSettings()
|
|||||||
timeout.setSuffix(tr("s"));
|
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
|
} // namespace VcsBase
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
Utils::IntegerAspect timeout; // Seconds
|
Utils::IntegerAspect timeout; // Seconds
|
||||||
Utils::StringAspect path;
|
Utils::StringAspect path;
|
||||||
|
|
||||||
QStringList searchPathList() const;
|
Utils::FilePaths searchPathList() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_settingsGroup;
|
QString m_settingsGroup;
|
||||||
|
Reference in New Issue
Block a user