Apply current filter to search results

QHelpSearchIndexReaderDefault is run in a separate thread
in order to return the results of the search. It reads
the info about the current filter in order to filter out
the results. However, the main thread didn't
store the current filter in the qhc file, just in memory,
and the search thread reads the value of the current filter
from qhc file, so this goes out of sync.

This patch stores the current filter in the qhc file
whenever it is changed.

The current code resets the current filter
by the launch of creator anyway.

Task-number: QTCREATORBUG-17845
Change-Id: I7c8d2c93b319c94e1400a677ecee9e9b41b029c3
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2017-03-10 12:30:27 +01:00
parent 3b901b25a8
commit 3261e73b0c
2 changed files with 1 additions and 5 deletions

View File

@@ -380,8 +380,6 @@ void HelpManager::setupHelpManager()
// create the help engine
d->m_helpEngine = new QHelpEngineCore(collectionFilePath(), m_instance);
d->m_helpEngine->setAutoSaveFilter(false);
d->m_helpEngine->setCurrentFilter(tr("Unfiltered"));
d->m_helpEngine->setupData();
foreach (const QString &filePath, d->documentationFromInstaller())

View File

@@ -304,10 +304,8 @@ QHelpEngine &LocalHelpManager::helpEngine()
{
if (!m_guiEngine) {
QMutexLocker _(&m_guiMutex);
if (!m_guiEngine) {
if (!m_guiEngine)
m_guiEngine = new QHelpEngine(QString());
m_guiEngine->setAutoSaveFilter(false);
}
}
return *m_guiEngine;
}