fix(registry): use QMultiMap instead of deprecated QMap::insertMulti()

This commit is contained in:
Oleg Shparber 2020-06-14 13:43:56 -04:00
parent 1f14668fcf
commit bf64b4ffdd
2 changed files with 7 additions and 6 deletions

View File

@ -446,7 +446,7 @@ void Docset::countSymbols()
}
const QString symbolType = parseSymbolType(symbolTypeStr);
m_symbolStrings.insertMulti(symbolType, symbolTypeStr);
m_symbolStrings.insert(symbolType, symbolTypeStr);
m_symbolCounts[symbolType] += m_db->value(1).toInt();
}
}
@ -485,9 +485,9 @@ void Docset::loadSymbols(const QString &symbolType, const QString &symbolString)
QMap<QString, QUrl> &symbols = m_symbols[symbolType];
while (m_db->next()) {
symbols.insertMulti(m_db->value(0).toString(),
createPageUrl(m_db->value(1).toString(),
m_db->value(2).toString()));
symbols.insert(m_db->value(0).toString(),
createPageUrl(m_db->value(1).toString(),
m_db->value(2).toString()));
}
}

View File

@ -27,6 +27,7 @@
#include <QIcon>
#include <QMap>
#include <QMetaObject>
#include <QMultiMap>
#include <QUrl>
namespace Zeal {
@ -115,9 +116,9 @@ private:
QUrl m_indexFileUrl;
QString m_indexFilePath;
QMap<QString, QString> m_symbolStrings;
QMultiMap<QString, QString> m_symbolStrings;
QMap<QString, int> m_symbolCounts;
mutable QMap<QString, QMap<QString, QUrl>> m_symbols;
mutable QMap<QString, QMultiMap<QString, QUrl>> m_symbols;
Util::SQLiteDatabase *m_db = nullptr;
bool m_fuzzySearchEnabled = false;
bool m_javaScriptEnabled = false;