forked from qt-creator/qt-creator
Fix deprecation warning when using linksForKeyword()
Change-Id: I6c8beeabb82f0a50def944ee893753a229c41908 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
This commit is contained in:
@@ -47,6 +47,11 @@
|
|||||||
#include <QHelpEngine>
|
#include <QHelpEngine>
|
||||||
#include <QHelpIndexModel>
|
#include <QHelpIndexModel>
|
||||||
|
|
||||||
|
#ifdef HELP_NEW_FILTER_ENGINE
|
||||||
|
#include <QHelpLink>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
using namespace Help::Internal;
|
using namespace Help::Internal;
|
||||||
|
|
||||||
IndexWindow::IndexWindow()
|
IndexWindow::IndexWindow()
|
||||||
@@ -195,8 +200,16 @@ void IndexWindow::disableSearchLineEdit()
|
|||||||
|
|
||||||
void IndexWindow::open(const QModelIndex &index, bool newPage)
|
void IndexWindow::open(const QModelIndex &index, bool newPage)
|
||||||
{
|
{
|
||||||
QString keyword = m_filteredIndexModel->data(index, Qt::DisplayRole).toString();
|
const QString keyword = m_filteredIndexModel->data(index, Qt::DisplayRole).toString();
|
||||||
QMultiMap<QString, QUrl> links = LocalHelpManager::helpEngine().indexModel()->linksForKeyword(keyword);
|
#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);
|
emit linksActivated(links, keyword, newPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user