mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Merge pull request #2875 from pmzqla/qvarianthash
WebUI: Convert torrent list from QVariantHash to QVariantMap
This commit is contained in:
commit
167d20083d
1 changed files with 11 additions and 0 deletions
|
@ -739,6 +739,17 @@ QVariantMap generateSyncData(int acceptedResponseId, QVariantMap data, QVariantM
|
||||||
if (fullUpdate) {
|
if (fullUpdate) {
|
||||||
lastAcceptedData.clear();
|
lastAcceptedData.clear();
|
||||||
syncData = data;
|
syncData = data;
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && QT_VERSION < QT_VERSION_CHECK(5, 5, 0))
|
||||||
|
// QJsonDocument::fromVariant() supports QVariantHash only
|
||||||
|
// since Qt5.5, so manually convert data["torrents"]
|
||||||
|
QVariantMap torrentsMap;
|
||||||
|
QVariantHash torrents = data["torrents"].toHash();
|
||||||
|
foreach (const QString &key, torrents.keys())
|
||||||
|
torrentsMap[key] = torrents[key];
|
||||||
|
syncData["torrents"] = torrentsMap;
|
||||||
|
#endif
|
||||||
|
|
||||||
syncData[KEY_FULL_UPDATE] = true;
|
syncData[KEY_FULL_UPDATE] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue