summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2017-08-25 17:02:29 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2018-04-23 14:14:34 +0000
commit829f9dec6bff57e8b3f1afdc982778a9d573174f (patch)
tree908d7930a11e24b621074ace5b3509a63a61d4f6 /tests
parent58bf8789242b0775d491c8969abae8f42f2bc32d (diff)
Store the copy of the index inside the help collection file
This avoids having to open all .qch files at startup, which is slow and can lead to contention on open file handles. This change is backward compatible. The old help lib won't use the new tables. The new help lib will generate the new tables on first run or regenerate them when it detects they are not anymore in sync. Store also the timestamp info about the qch files and compare it upon every startup. If it doesn't match then new tables' data is regenerated. The case when running new Creator, then running old Creator and reconfiguring doc set and then running new Creator again should work properly. Task-number: QTCREATORBUG-18242 Change-Id: I7f656935ae2383b866b27e256eec23dab588efc5 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp4
-rw-r--r--tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp
index 63ee55cbc..5a39cc923 100644
--- a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp
+++ b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.cpp
@@ -135,7 +135,7 @@ void tst_QHelpContentModel::contentItemAt()
QCOMPARE(h.currentFilter(), QString("unfiltered"));
- QModelIndex root = m->index(0, 0);
+ QModelIndex root = m->index(2, 0);
if (!root.isValid())
QFAIL("Cannot retrieve root item!");
QHelpContentItem *item = m->contentItemAt(root);
@@ -146,7 +146,7 @@ void tst_QHelpContentModel::contentItemAt()
item = m->contentItemAt(m->index(4, 0, root));
QCOMPARE(item->title(), QString("qmake Concepts"));
- item = m->contentItemAt(m->index(3, 0));
+ item = m->contentItemAt(m->index(1, 0));
QCOMPARE(item->title(), QString("Fancy Manual"));
w.start();
diff --git a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
index 494355c5d..713c229ce 100644
--- a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
+++ b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.cpp
@@ -170,11 +170,11 @@ void tst_QHelpIndexModel::linksForIndex()
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"));
+ 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"));
+ QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/fancy.html#foo"));
map = m->linksForKeyword("foobar");
QCOMPARE(map.count(), 1);
@@ -193,7 +193,7 @@ void tst_QHelpIndexModel::linksForIndex()
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"));
+ QUrl("qthelp://trolltech.com.1-0-0.test/testFolder/test.html#foo"));
}
QTEST_MAIN(tst_QHelpIndexModel)