diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2017-05-04 14:16:09 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2017-05-09 09:08:58 +0000 |
commit | a53c052ee3c8d94b9c23ca1e29369de2faecbc1c (patch) | |
tree | 2db6a93beee024bf501ce3f06c83c0bf37cc442c | |
parent | 15db04e57cf8bcc2ba2fa3248a2928b23f4667ab (diff) | |
download | qttools-a53c052ee3c8d94b9c23ca1e29369de2faecbc1c.tar.gz |
Move the linksForKeyword from QHelpModelIndex to QHelpEngineCore
Obsolete it inside QHelpModelIndex.
Change-Id: I11f1e67c6eac6e6790a7c73d5850f5b415214db1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r-- | src/assistant/help/qhelpenginecore.cpp | 15 | ||||
-rw-r--r-- | src/assistant/help/qhelpenginecore.h | 1 | ||||
-rw-r--r-- | src/assistant/help/qhelpindexwidget.cpp | 10 |
3 files changed, 19 insertions, 7 deletions
diff --git a/src/assistant/help/qhelpenginecore.cpp b/src/assistant/help/qhelpenginecore.cpp index 4debf8247..b3396f2fe 100644 --- a/src/assistant/help/qhelpenginecore.cpp +++ b/src/assistant/help/qhelpenginecore.cpp @@ -640,6 +640,21 @@ QMap<QString, QUrl> QHelpEngineCore::linksForIdentifier(const QString &id) const } /*! + \since 4.5 + + Returns all documents found for the \a keyword. The returned map consists of the + document titles and their URLs. +*/ +QMap<QString, QUrl> QHelpEngineCore::linksForKeyword(const QString &keyword) const +{ + QMap<QString, QUrl> linkMap; + const QStringList &attributes = filterAttributes(d->currentFilter); + for (const QHelpDBReader *reader : qAsConst(d->readerMap)) + reader->linksForKeyword(keyword, attributes, &linkMap); + return linkMap; +} + +/*! Removes the \a key from the settings section in the collection file. Returns true if the value was removed successfully, otherwise false. diff --git a/src/assistant/help/qhelpenginecore.h b/src/assistant/help/qhelpenginecore.h index 47c136fe4..c3e446b05 100644 --- a/src/assistant/help/qhelpenginecore.h +++ b/src/assistant/help/qhelpenginecore.h @@ -95,6 +95,7 @@ public: QByteArray fileData(const QUrl &url) const; QMap<QString, QUrl> linksForIdentifier(const QString &id) const; + QMap<QString, QUrl> linksForKeyword(const QString &keyword) const; bool removeCustomValue(const QString &key); QVariant customValue(const QString &key, diff --git a/src/assistant/help/qhelpindexwidget.cpp b/src/assistant/help/qhelpindexwidget.cpp index 5cb4a56d4..abd3b40e8 100644 --- a/src/assistant/help/qhelpindexwidget.cpp +++ b/src/assistant/help/qhelpindexwidget.cpp @@ -277,16 +277,12 @@ bool QHelpIndexModel::isCreatingIndex() const } /*! - Returns all documents found for the \a keyword. The returned map consists of the - document titles and their URLs. + \obsolete + Use QHelpEngineCore::linksForKeyword() instead. */ QMap<QString, QUrl> QHelpIndexModel::linksForKeyword(const QString &keyword) const { - QMap<QString, QUrl> linkMap; - const QStringList &attributes = d->helpEngine->q->filterAttributes(d->currentFilter); - for (const QHelpDBReader *reader : d->activeReaders) - reader->linksForKeyword(keyword, attributes, &linkMap); - return linkMap; + return d->helpEngine->q->linksForKeyword(keyword); } /*! |