aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-10-04 12:54:55 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-10-04 11:51:20 +0000
commitc666c938822dbdd7f74bc44a6b31bee171ee5c63 (patch)
tree9253193f07b9e3aa3f013fbcb4b4bcb3bddb0603 /src/plugins/git
parent34f9229eef671a9d6297d748f79d076cc20e84b8 (diff)
VcsBasePlugin: Use more FilePath
Change-Id: I7bc80245b093b210439efdf3ea353b52b288dcc0 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/git')
-rw-r--r--src/plugins/git/gitclient.cpp10
-rw-r--r--src/plugins/git/gitgrep.cpp2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index d018c2b60b..d5c3775c93 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -3847,10 +3847,10 @@ FilePath GitClient::fileWorkingDirectory(const QString &file)
IEditor *GitClient::openShowEditor(const FilePath &workingDirectory, const QString &ref,
const QString &path, ShowEditor showSetting)
{
- QString topLevel;
- VcsManager::findVersionControlForDirectory(workingDirectory, &topLevel);
- const QString relativePath = QDir(topLevel).relativeFilePath(path);
- const QByteArray content = synchronousShow(FilePath::fromString(topLevel), ref + ":" + relativePath);
+ const FilePath topLevel = VcsManager::findTopLevelForDirectory(workingDirectory);
+ const QString topLevelString = topLevel.toString();
+ const QString relativePath = QDir(topLevelString).relativeFilePath(path);
+ const QByteArray content = synchronousShow(topLevel, ref + ":" + relativePath);
if (showSetting == ShowEditor::OnlyIfDifferent) {
if (content.isEmpty())
return nullptr;
@@ -3866,7 +3866,7 @@ IEditor *GitClient::openShowEditor(const FilePath &workingDirectory, const QStri
}
const QString documentId = QLatin1String(Git::Constants::GIT_PLUGIN)
- + QLatin1String(".GitShow.") + topLevel
+ + QLatin1String(".GitShow.") + topLevelString
+ QLatin1String(".") + relativePath;
QString title = tr("Git Show %1:%2").arg(ref).arg(relativePath);
IEditor *editor = EditorManager::openEditorWithContents(Id(), &title, content, documentId,
diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp
index f5101d5699..abcea246bf 100644
--- a/src/plugins/git/gitgrep.cpp
+++ b/src/plugins/git/gitgrep.cpp
@@ -198,7 +198,7 @@ static bool isGitDirectory(const FilePath &path)
{
static IVersionControl *gitVc = VcsManager::versionControl(VcsBase::Constants::VCS_ID_GIT);
QTC_ASSERT(gitVc, return false);
- return gitVc == VcsManager::findVersionControlForDirectory(path, nullptr);
+ return gitVc == VcsManager::findVersionControlForDirectory(path);
}
GitGrep::GitGrep(GitClient *client)