diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-07-02 22:52:53 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2014-07-03 10:22:37 +0200 |
commit | 342cb69dda9b5232257be37890d3ed0b6982d3b0 (patch) | |
tree | a7731af28758e4069443e33b3d4d474e0002bf9b /src/plugins/coreplugin | |
parent | 8a1bb5aeb3adf5962a8e1972091da138a729008a (diff) | |
download | qt-creator-342cb69dda9b5232257be37890d3ed0b6982d3b0.tar.gz |
Core: Add a convenience findTopLevelForDirectory to VcsManager
Change-Id: If5a846e0793b25b738084cacb8dba51fb80399d4
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/coreplugin')
-rw-r--r-- | src/plugins/coreplugin/vcsmanager.cpp | 7 | ||||
-rw-r--r-- | src/plugins/coreplugin/vcsmanager.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index 8c62048101..af42e777fc 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -339,6 +339,13 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &input return versionControl; } +QString VcsManager::findTopLevelForDirectory(const QString &directory) +{ + QString result; + findVersionControlForDirectory(directory, &result); + return result; +} + QStringList VcsManager::repositories(const IVersionControl *vc) { QStringList result; diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 13051ea69c..a8f83c4987 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -65,6 +65,7 @@ public: static void resetVersionControlForDirectory(const QString &inputDirectory); static IVersionControl *findVersionControlForDirectory(const QString &directory, QString *topLevelDirectory = 0); + static QString findTopLevelForDirectory(const QString &directory); static QStringList repositories(const IVersionControl *); |