Core: Add a convenience findTopLevelForDirectory to VcsManager

Change-Id: If5a846e0793b25b738084cacb8dba51fb80399d4
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2014-07-02 22:52:53 +03:00
committed by Orgad Shaneh
parent 8a1bb5aeb3
commit 342cb69dda
4 changed files with 11 additions and 5 deletions

View File

@@ -108,10 +108,9 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
VariableManager::registerVariable(Constants::VAR_VCS_TOPLEVELPATH,
tr("The top level path to the repository the current project is in."),
[]() -> QString {
QString topLevel;
if (Project *project = ProjectExplorerPlugin::currentProject())
VcsManager::findVersionControlForDirectory(project->projectDirectory().toString(), &topLevel);
return topLevel;
return VcsManager::findTopLevelForDirectory(project->projectDirectory().toString());
return QString();
});
return true;