mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
OpenSearch: Fix loading search suggestions
This commit is contained in:
parent
cbc83e81ba
commit
90abf57592
@ -627,17 +627,17 @@ void OpenSearchEngine::suggestionsObtained()
|
|||||||
QJsonDocument json = QJsonDocument::fromJson(response);
|
QJsonDocument json = QJsonDocument::fromJson(response);
|
||||||
const QVariant res = json.toVariant();
|
const QVariant res = json.toVariant();
|
||||||
|
|
||||||
if (err.error != QJsonParseError::NoError || res.type() != QVariant::Map)
|
if (err.error != QJsonParseError::NoError || res.type() != QVariant::List)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const QVariantList list = res.toMap().value(QSL("1")).toList();
|
const QVariantList list = res.toList();
|
||||||
|
|
||||||
if (list.isEmpty())
|
if (list.size() < 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QStringList out;
|
QStringList out;
|
||||||
|
|
||||||
foreach (const QVariant &v, list)
|
foreach (const QVariant &v, list.at(1).toList())
|
||||||
out.append(v.toString());
|
out.append(v.toString());
|
||||||
|
|
||||||
emit suggestions(out);
|
emit suggestions(out);
|
||||||
|
Loading…
Reference in New Issue
Block a user