aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitgrep.cpp
diff options
context:
space:
mode:
authorJarek Kobus <[email protected]>2016-11-24 09:58:11 +0100
committerJarek Kobus <[email protected]>2017-01-10 15:14:19 +0000
commit8b67458a9567fe4f83d3658916f5534617316b02 (patch)
tree1d35569f8a2c30807c1bcd8c13968d4fdcf6a8a4 /src/plugins/git/gitgrep.cpp
parentacb07875b7f5578fae26a5230ccf37ba35936e51 (diff)
Prefix editor's uniqueId with plugin name
In this way we minimize the chance of generating non-unique id. Change-Id: Idd177c5a4b44b17a58c2a944ec77b9517e91964e Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins/git/gitgrep.cpp')
-rw-r--r--src/plugins/git/gitgrep.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp
index cf961487d6b..8bb26b244ea 100644
--- a/src/plugins/git/gitgrep.cpp
+++ b/src/plugins/git/gitgrep.cpp
@@ -25,6 +25,7 @@
#include "gitgrep.h"
#include "gitclient.h"
+#include "gitconstants.h"
#include "gitplugin.h"
#include <coreplugin/editormanager/editormanager.h>
@@ -294,8 +295,12 @@ IEditor *GitGrep::openEditor(const SearchResultItem &item,
if (fileContent == content)
return nullptr; // open the file for read/write
}
+
+ const QString documentId = QLatin1String(Git::Constants::GIT_PLUGIN)
+ + QLatin1String(".GitShow.") + params.ref
+ + QLatin1String(".") + relativePath;
QString title = tr("Git Show %1:%2").arg(params.ref).arg(relativePath);
- IEditor *editor = EditorManager::openEditorWithContents(Id(), &title, content, title,
+ IEditor *editor = EditorManager::openEditorWithContents(Id(), &title, content, documentId,
EditorManager::DoNotSwitchToDesignMode);
editor->gotoLine(item.mainRange.begin.line, item.mainRange.begin.column);
editor->document()->setTemporary(true);