aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-04-03 07:41:26 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-04-03 08:38:24 +0000
commit4eb5adee3f412925f7048c07ca179ea8d05f990d (patch)
treee1182e14f070102dacb742e5276ffbb7bd04d143 /src/shared
parent9cfd1b5d6ccdd2c70dee3b80c74a7ff4ecc8bc5c (diff)
Fix deprecation warning when using linksForKeyword()
Change-Id: I6c8beeabb82f0a50def944ee893753a229c41908 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/help/indexwindow.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/shared/help/indexwindow.cpp b/src/shared/help/indexwindow.cpp
index 41eea6c213..af58ff8739 100644
--- a/src/shared/help/indexwindow.cpp
+++ b/src/shared/help/indexwindow.cpp
@@ -47,6 +47,11 @@
#include <QHelpEngine>
#include <QHelpIndexModel>
+#ifdef HELP_NEW_FILTER_ENGINE
+#include <QHelpLink>
+#endif
+
+
using namespace Help::Internal;
IndexWindow::IndexWindow()
@@ -195,8 +200,16 @@ void IndexWindow::disableSearchLineEdit()
void IndexWindow::open(const QModelIndex &index, bool newPage)
{
- QString keyword = m_filteredIndexModel->data(index, Qt::DisplayRole).toString();
- QMultiMap<QString, QUrl> links = LocalHelpManager::helpEngine().indexModel()->linksForKeyword(keyword);
+ const QString keyword = m_filteredIndexModel->data(index, Qt::DisplayRole).toString();
+#ifndef HELP_NEW_FILTER_ENGINE
+ QMultiMap<QString, QUrl> links = LocalHelpManager::helpEngine().linksForKeyword(keyword);
+#else
+ QMultiMap<QString, QUrl> links;
+ const QList<QHelpLink> docs = LocalHelpManager::helpEngine().documentsForKeyword(keyword);
+ for (const auto doc : docs)
+ links.insert(doc.title, doc.url);
+
+#endif
emit linksActivated(links, keyword, newPage);
}