forked from qt-creator/qt-creator
GitGrep: Pass GitGrepParameters through the lambda capture
Instead of using QVariant searchEngineParameters. Change-Id: I30b2bf06fb16586b11e22410e1662d3127ae97be Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -245,13 +245,14 @@ QWidget *GitGrep::widget() const
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
GitGrepParameters GitGrep::gitParameters() const
|
||||
{
|
||||
return {m_treeLineEdit->text(), m_recurseSubmodules && m_recurseSubmodules->isChecked()};
|
||||
}
|
||||
|
||||
QVariant GitGrep::parameters() const
|
||||
{
|
||||
GitGrepParameters params;
|
||||
params.ref = m_treeLineEdit->text();
|
||||
if (m_recurseSubmodules)
|
||||
params.recurseSubmodules = m_recurseSubmodules->isChecked();
|
||||
return QVariant::fromValue(params);
|
||||
return QVariant::fromValue(gitParameters());
|
||||
}
|
||||
|
||||
void GitGrep::readSettings(QSettings *settings)
|
||||
@@ -271,9 +272,8 @@ QFuture<SearchResultItems> GitGrep::executeSearch(const FileFindParameters ¶
|
||||
|
||||
EditorOpener GitGrep::editorOpener() const
|
||||
{
|
||||
return [](const Utils::SearchResultItem &item,
|
||||
const FileFindParameters ¶meters) -> IEditor * {
|
||||
const GitGrepParameters params = parameters.searchEngineParameters.value<GitGrepParameters>();
|
||||
return [params = gitParameters()](const Utils::SearchResultItem &item,
|
||||
const FileFindParameters ¶meters) -> IEditor * {
|
||||
const QStringList &itemPath = item.path();
|
||||
if (params.ref.isEmpty() || itemPath.isEmpty())
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user