Core: Streamline SearchResultWindow interface

That is, make SearchResultItem the one data type for adding search
results.
This will allow us to add additional properties to search results
without adding more and more parameters to a bunch of functions.

Change-Id: Ic2740477ae47449cee75caa2525727fe2b460f91
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2021-02-11 16:22:48 +01:00
parent fa5fdef6e1
commit d3deefc3a4
17 changed files with 136 additions and 157 deletions

View File

@@ -312,13 +312,13 @@ IEditor *GitGrep::openEditor(const SearchResultItem &item,
const TextEditor::FileFindParameters &parameters)
{
GitGrepParameters params = parameters.searchEngineParameters.value<GitGrepParameters>();
if (params.ref.isEmpty() || item.path.isEmpty())
if (params.ref.isEmpty() || item.path().isEmpty())
return nullptr;
const QString path = QDir::fromNativeSeparators(item.path.first());
const QString path = QDir::fromNativeSeparators(item.path().first());
const QString topLevel = parameters.additionalParameters.toString();
IEditor *editor = m_client->openShowEditor(
topLevel, params.ref, path, GitClient::ShowEditor::OnlyIfDifferent);
editor->gotoLine(item.mainRange.begin.line, item.mainRange.begin.column);
editor->gotoLine(item.mainRange().begin.line, item.mainRange().begin.column);
return editor;
}