mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-09 22:04:21 +03:00
fix(registry): fix incorrect QMultiMap casts
This caused a crash affecting docsets which contained multiple symbols with identical names and types.
This commit is contained in:
parent
7fa29c9770
commit
dc4d476d20
@ -283,7 +283,7 @@ int Docset::symbolCount(const QString &symbolType) const
|
||||
return m_symbolCounts.value(symbolType);
|
||||
}
|
||||
|
||||
const QMap<QString, QUrl> &Docset::symbols(const QString &symbolType) const
|
||||
const QMultiMap<QString, QUrl> &Docset::symbols(const QString &symbolType) const
|
||||
{
|
||||
if (!m_symbols.contains(symbolType))
|
||||
loadSymbols(symbolType);
|
||||
@ -483,7 +483,7 @@ void Docset::loadSymbols(const QString &symbolType, const QString &symbolString)
|
||||
return;
|
||||
}
|
||||
|
||||
QMap<QString, QUrl> &symbols = m_symbols[symbolType];
|
||||
QMultiMap<QString, QUrl> &symbols = m_symbols[symbolType];
|
||||
while (m_db->next()) {
|
||||
symbols.insert(m_db->value(0).toString(),
|
||||
createPageUrl(m_db->value(1).toString(),
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
QMap<QString, int> symbolCounts() const;
|
||||
int symbolCount(const QString &symbolType) const;
|
||||
|
||||
const QMap<QString, QUrl> &symbols(const QString &symbolType) const;
|
||||
const QMultiMap<QString, QUrl> &symbols(const QString &symbolType) const;
|
||||
|
||||
QList<SearchResult> search(const QString &query, const CancellationToken &token) const;
|
||||
QList<SearchResult> relatedLinks(const QUrl &url) const;
|
||||
|
Loading…
Reference in New Issue
Block a user