forked from qt-creator/qt-creator
Integrate new filter engine
Adapt the code to deprecated usage of map as a multi map, hence all cases replaced by QMultiMap. Change-Id: I2d480467cd6e91d3e880555e6a21058dec056b3f Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
This commit is contained in:
@@ -70,10 +70,14 @@ QHelpEngine* LocalHelpManager::m_guiEngine = nullptr;
|
||||
QMutex LocalHelpManager::m_bkmarkMutex;
|
||||
BookmarkManager* LocalHelpManager::m_bookmarkManager = nullptr;
|
||||
|
||||
#ifndef HELP_NEW_FILTER_ENGINE
|
||||
|
||||
QStandardItemModel *LocalHelpManager::m_filterModel = nullptr;
|
||||
QString LocalHelpManager::m_currentFilter = QString();
|
||||
int LocalHelpManager::m_currentFilterIndex = -1;
|
||||
|
||||
#endif
|
||||
|
||||
static const char kHelpHomePageKey[] = "Help/HomePage";
|
||||
static const char kFontFamilyKey[] = "Help/FallbackFontFamily";
|
||||
static const char kFontStyleNameKey[] = "Help/FallbackFontStyleName";
|
||||
@@ -123,7 +127,9 @@ LocalHelpManager::LocalHelpManager(QObject *parent)
|
||||
{
|
||||
m_instance = this;
|
||||
qRegisterMetaType<Help::Internal::LocalHelpManager::HelpData>("Help::Internal::LocalHelpManager::HelpData");
|
||||
#ifndef HELP_NEW_FILTER_ENGINE
|
||||
m_filterModel = new QStandardItemModel(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
LocalHelpManager::~LocalHelpManager()
|
||||
@@ -396,8 +402,12 @@ QHelpEngine &LocalHelpManager::helpEngine()
|
||||
{
|
||||
if (!m_guiEngine) {
|
||||
QMutexLocker _(&m_guiMutex);
|
||||
if (!m_guiEngine)
|
||||
if (!m_guiEngine) {
|
||||
m_guiEngine = new QHelpEngine(QString());
|
||||
#ifdef HELP_NEW_FILTER_ENGINE
|
||||
m_guiEngine->setUsesFilterEngine(true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return *m_guiEngine;
|
||||
}
|
||||
@@ -495,6 +505,8 @@ LocalHelpManager::HelpData LocalHelpManager::helpData(const QUrl &url)
|
||||
return data;
|
||||
}
|
||||
|
||||
#ifndef HELP_NEW_FILTER_ENGINE
|
||||
|
||||
QAbstractItemModel *LocalHelpManager::filterModel()
|
||||
{
|
||||
return m_filterModel;
|
||||
@@ -544,6 +556,15 @@ void LocalHelpManager::updateFilterModel()
|
||||
emit m_instance->filterIndexChanged(m_currentFilterIndex);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
QHelpFilterEngine *LocalHelpManager::filterEngine()
|
||||
{
|
||||
return helpEngine().filterEngine();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool LocalHelpManager::canOpenOnlineHelp(const QUrl &url)
|
||||
{
|
||||
const QString address = url.toString();
|
||||
|
||||
Reference in New Issue
Block a user