summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-24 17:49:44 +0200
committerLars Knoll <lars.knoll@qt.io>2020-08-24 21:37:09 +0200
commit1fcc136e74f85a6eeac6508b7138a375e8ced1c5 (patch)
tree33f974b73fa3c2d269b0183fb46109fbd50a3909
parentc3ca1f972e402281d3ec42498d3051767449a41b (diff)
Remove deprecated functionality
Required to get the module to compile against a new qtbase Change-Id: I4f7c6f10c94da640c1f1eec0bbbbc22bbd7cb2ea Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--examples/help/contextsensitivehelp/helpbrowser.cpp7
-rw-r--r--src/assistant/help/qhelpenginecore.cpp48
-rw-r--r--src/assistant/help/qhelpenginecore.h7
-rw-r--r--src/assistant/help/qhelpindexwidget.cpp14
-rw-r--r--src/assistant/help/qhelpindexwidget.h4
-rw-r--r--tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp23
-rw-r--r--tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp46
7 files changed, 4 insertions, 145 deletions
diff --git a/examples/help/contextsensitivehelp/helpbrowser.cpp b/examples/help/contextsensitivehelp/helpbrowser.cpp
index 0eb983c05..f0cc4a1d7 100644
--- a/examples/help/contextsensitivehelp/helpbrowser.cpp
+++ b/examples/help/contextsensitivehelp/helpbrowser.cpp
@@ -53,6 +53,7 @@
#include <QtHelp/QHelpEngineCore>
#include "helpbrowser.h"
+#include "qhelplink.h"
HelpBrowser::HelpBrowser(QWidget *parent)
: QTextBrowser(parent)
@@ -70,9 +71,9 @@ HelpBrowser::HelpBrowser(QWidget *parent)
void HelpBrowser::showHelpForKeyword(const QString &id)
{
if (m_helpEngine) {
- QMultiMap<QString, QUrl> links = m_helpEngine->linksForIdentifier(id);
- if (links.count())
- setSource(links.constBegin().value());
+ QList<QHelpLink> documents = m_helpEngine->documentsForIdentifier(id);
+ if (documents.count())
+ setSource(documents.first().url);
}
}
diff --git a/src/assistant/help/qhelpenginecore.cpp b/src/assistant/help/qhelpenginecore.cpp
index d3026dc49..81e224b37 100644
--- a/src/assistant/help/qhelpenginecore.cpp
+++ b/src/assistant/help/qhelpenginecore.cpp
@@ -611,30 +611,6 @@ QByteArray QHelpEngineCore::fileData(const QUrl &url) const
return d->collectionHandler->fileData(url);
}
-#if QT_DEPRECATED_SINCE(5, 15)
-/*!
- \obsolete
-
- Use documentsForIdentifier() instead.
-
- Returns a map of the documents found for the \a id. The map contains the
- document titles and their URLs. The returned map contents depend on
- the current filter, and therefore only the identifiers registered for
- the current filter will be returned.
-*/
-QMultiMap<QString, QUrl> QHelpEngineCore::linksForIdentifier(const QString &id) const
-{
- if (!d->setup())
- return QMultiMap<QString, QUrl>();
-
- if (d->usesFilterEngine)
- return d->collectionHandler->linksForIdentifier(id, d->filterEngine->activeFilter());
-
- // obsolete
- return d->collectionHandler->linksForIdentifier(id, filterAttributes(d->currentFilter));
-}
-#endif
-
/*!
\since 5.15
@@ -665,30 +641,6 @@ QList<QHelpLink> QHelpEngineCore::documentsForIdentifier(const QString &id, cons
return d->collectionHandler->documentsForIdentifier(id, filterName);
}
-#if QT_DEPRECATED_SINCE(5, 15)
-/*!
- \obsolete
-
- Use documentsForKeyword() instead.
-
- Returns a map of all the documents found for the \a keyword. The map
- contains the document titles and URLs. The returned map contents depend
- on the current filter, and therefore only the keywords registered for
- the current filter will be returned.
-*/
-QMultiMap<QString, QUrl> QHelpEngineCore::linksForKeyword(const QString &keyword) const
-{
- if (!d->setup())
- return QMultiMap<QString, QUrl>();
-
- if (d->usesFilterEngine)
- return d->collectionHandler->linksForKeyword(keyword, d->filterEngine->activeFilter());
-
- // obsolete
- return d->collectionHandler->linksForKeyword(keyword, filterAttributes(d->currentFilter));
-}
-#endif
-
/*!
\since 5.15
diff --git a/src/assistant/help/qhelpenginecore.h b/src/assistant/help/qhelpenginecore.h
index 92ddbe0d5..df95c512f 100644
--- a/src/assistant/help/qhelpenginecore.h
+++ b/src/assistant/help/qhelpenginecore.h
@@ -105,13 +105,6 @@ public:
const QString &extensionFilter = QString());
QUrl findFile(const QUrl &url) const;
-#if QT_DEPRECATED_SINCE(5, 15)
- QT_DEPRECATED_X("Use documentsForIdentifier() instead")
- QMultiMap<QString, QUrl> linksForIdentifier(const QString &id) const;
- QT_DEPRECATED_X("Use documentsForKeyword() instead")
- QMultiMap<QString, QUrl> linksForKeyword(const QString &keyword) const;
-#endif
-
QList<QHelpLink> documentsForIdentifier(const QString &id) const;
QList<QHelpLink> documentsForIdentifier(const QString &id, const QString &filterName) const;
QList<QHelpLink> documentsForKeyword(const QString &keyword) const;
diff --git a/src/assistant/help/qhelpindexwidget.cpp b/src/assistant/help/qhelpindexwidget.cpp
index 32c23bbae..0e2287e56 100644
--- a/src/assistant/help/qhelpindexwidget.cpp
+++ b/src/assistant/help/qhelpindexwidget.cpp
@@ -233,20 +233,6 @@ QHelpEngineCore *QHelpIndexModel::helpEngine() const
return d->helpEngine->q;
}
-#if QT_DEPRECATED_SINCE(5, 15)
-/*!
- \obsolete
- Use QHelpEngineCore::documentsForKeyword() instead.
-*/
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
-QMultiMap<QString, QUrl> QHelpIndexModel::linksForKeyword(const QString &keyword) const
-{
- return d->helpEngine->q->linksForKeyword(keyword);
-}
-QT_WARNING_POP
-#endif
-
/*!
Filters the indices and returns the model index of the best
matching keyword. In a first step, only the keywords containing
diff --git a/src/assistant/help/qhelpindexwidget.h b/src/assistant/help/qhelpindexwidget.h
index 600a52465..e3ffcba80 100644
--- a/src/assistant/help/qhelpindexwidget.h
+++ b/src/assistant/help/qhelpindexwidget.h
@@ -63,10 +63,6 @@ public:
QModelIndex filter(const QString &filter,
const QString &wildcard = QString());
-#if QT_DEPRECATED_SINCE(5, 15)
- QT_DEPRECATED_X("Use QHelpEngineCore::documentsForKeyword() instead")
- QMultiMap<QString, QUrl> linksForKeyword(const QString &keyword) const;
-#endif
bool isCreatingIndex() const;
QHelpEngineCore *helpEngine() const;
diff --git a/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp b/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
index ddadda10b..773a2bcfb 100644
--- a/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
+++ b/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
@@ -64,8 +64,6 @@ private slots:
void files();
void fileData();
- void linksForIdentifier();
-
void customValue();
void setCustomValue();
void removeCustomValue();
@@ -377,27 +375,6 @@ void tst_QHelpEngineCore::fileData()
QCOMPARE(s.readAll(), ts.readAll());
}
-void tst_QHelpEngineCore::linksForIdentifier()
-{
- QHelpEngineCore help(m_colFile, 0);
- QCOMPARE(help.setupData(), true);
- QMap<QString, QUrl> map;
- map = help.linksForIdentifier("Test::foo");
- QCOMPARE(map.contains("Test Manual"), true);
- QCOMPARE(map.count(), 1);
- QCOMPARE(map.value("Test Manual"),
- QUrl("qthelp://trolltech.com.1.0.0.test/testFolder/test.html#foo"));
-
- help.setCurrentFilter("Custom Filter 2");
- map = help.linksForIdentifier("People::newton");
- QCOMPARE(map.isEmpty(), true);
- map = help.linksForIdentifier("Fancy::foobar");
- QCOMPARE(map.contains("Fancy"), true);
- QCOMPARE(map.count(), 1);
- QCOMPARE(map.value("Fancy"),
- QUrl("qthelp://trolltech.com.1.0.0.test/testFolder/fancy.html#foobar"));
-}
-
void tst_QHelpEngineCore::customValue()
{
QHelpEngineCore help(m_colFile, 0);
diff --git a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
index d304c3f3b..358be9956 100644
--- a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
+++ b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
@@ -76,7 +76,6 @@ private slots:
void setupIndex();
void filter();
- void linksForIndex();
private:
QString m_colFile;
@@ -152,50 +151,5 @@ void tst_QHelpIndexModel::filter()
QCOMPARE(m->stringList().count(), 11);
}
-void tst_QHelpIndexModel::linksForIndex()
-{
- QHelpEngine h(m_colFile, 0);
- QHelpIndexModel *m = h.indexModel();
- SignalWaiter w;
- connect(m, SIGNAL(indexCreated()),
- &w, SLOT(stopWaiting()));
- w.start();
- h.setupData();
- int i = 0;
- while (w.isRunning() && i++ < 10)
- QTest::qWait(500);
-
- QCOMPARE(h.currentFilter(), QString("unfiltered"));
- QMap<QString, QUrl> map;
- map = m->linksForKeyword("foo");
- QCOMPARE(map.count(), 2);
- QCOMPARE(map.contains("Test Manual"), true);
- QCOMPARE(map.value("Test Manual"),
- QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/test.html#foo"));
-
- QCOMPARE(map.contains("Fancy"), true);
- QCOMPARE(map.value("Fancy"),
- QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/fancy.html#foo"));
-
- map = m->linksForKeyword("foobar");
- QCOMPARE(map.count(), 1);
- QCOMPARE(map.contains("Fancy"), true);
-
- map = m->linksForKeyword("notexisting");
- QCOMPARE(map.count(), 0);
-
- w.start();
- h.setCurrentFilter("Custom Filter 1");
- i = 0;
- while (w.isRunning() && i++ < 10)
- QTest::qWait(500);
-
- map = m->linksForKeyword("foo");
- QCOMPARE(map.count(), 1);
- QCOMPARE(map.contains("Test Manual"), true);
- QCOMPARE(map.value("Test Manual"),
- QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/test.html#foo"));
-}
-
QTEST_MAIN(tst_QHelpIndexModel)
#include "tst_qhelpindexmodel.moc"