From d2f12169879604651b737161d48bdb3cc9e6391a Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Mon, 21 Sep 2015 11:45:40 +0300 Subject: [PATCH 1/2] Fix compiler warnings (Closes #3826). --- src/webui/btjson.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index 22a71f783..99f386134 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -200,20 +200,20 @@ public: if (type_ == QVariant::Invalid) type_ = torrent1.toMap().value(key_).type(); - switch (type_) { - case QVariant::Int: + switch (static_cast(type_)) { + case QMetaType::Int: return greaterThan_ ? torrent1.toMap().value(key_).toInt() > torrent2.toMap().value(key_).toInt() : torrent1.toMap().value(key_).toInt() < torrent2.toMap().value(key_).toInt(); - case QVariant::LongLong: + case QMetaType::LongLong: return greaterThan_ ? torrent1.toMap().value(key_).toLongLong() > torrent2.toMap().value(key_).toLongLong() : torrent1.toMap().value(key_).toLongLong() < torrent2.toMap().value(key_).toLongLong(); - case QVariant::ULongLong: + case QMetaType::ULongLong: return greaterThan_ ? torrent1.toMap().value(key_).toULongLong() > torrent2.toMap().value(key_).toULongLong() : torrent1.toMap().value(key_).toULongLong() < torrent2.toMap().value(key_).toULongLong(); case QMetaType::Float: return greaterThan_ ? torrent1.toMap().value(key_).toFloat() > torrent2.toMap().value(key_).toFloat() : torrent1.toMap().value(key_).toFloat() < torrent2.toMap().value(key_).toFloat(); - case QVariant::Double: + case QMetaType::Double: return greaterThan_ ? torrent1.toMap().value(key_).toDouble() > torrent2.toMap().value(key_).toDouble() : torrent1.toMap().value(key_).toDouble() < torrent2.toMap().value(key_).toDouble(); default: @@ -652,15 +652,15 @@ void processMap(QVariantMap prevData, QVariantMap data, QVariantMap &syncData) foreach (QString key, data.keys()) { removedItems.clear(); - switch (data[key].type()) { - case QVariant::Map: { + switch (static_cast(data[key].type())) { + case QMetaType::QVariantMap: { QVariantMap map; processMap(prevData[key].toMap(), data[key].toMap(), map); if (!map.isEmpty()) syncData[key] = map; } break; - case QVariant::Hash: { + case QMetaType::QVariantHash: { QVariantMap map; processHash(prevData[key].toHash(), data[key].toHash(), map, removedItems); if (!map.isEmpty()) @@ -669,7 +669,7 @@ void processMap(QVariantMap prevData, QVariantMap data, QVariantMap &syncData) syncData[key + KEY_SUFFIX_REMOVED] = removedItems; } break; - case QVariant::List: { + case QMetaType::QVariantList: { QVariantList list; processList(prevData[key].toList(), data[key].toList(), list, removedItems); if (!list.isEmpty()) @@ -678,14 +678,14 @@ void processMap(QVariantMap prevData, QVariantMap data, QVariantMap &syncData) syncData[key + KEY_SUFFIX_REMOVED] = removedItems; } break; - case QVariant::String: - case QVariant::LongLong: + case QMetaType::QString: + case QMetaType::LongLong: case QMetaType::Float: - case QVariant::Int: - case QVariant::Bool: - case QVariant::Double: - case QVariant::ULongLong: - case QVariant::UInt: + case QMetaType::Int: + case QMetaType::Bool: + case QMetaType::Double: + case QMetaType::ULongLong: + case QMetaType::UInt: if (prevData[key] != data[key]) syncData[key] = data[key]; break; From 1a67282dd3b840926e39ace453f0770fd3e6c175 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Tue, 22 Sep 2015 19:34:07 +0300 Subject: [PATCH 2/2] Fix Qt4 qmake warning (unknown QT: concurrent). --- src/src.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/src.pro b/src/src.pro index 333160ad9..4cf21cc2c 100644 --- a/src/src.pro +++ b/src/src.pro @@ -20,7 +20,7 @@ nogui { TARGET = qbittorrent-nox } else { QT += xml - QT += concurrent + greaterThan(QT_MAJOR_VERSION, 4): QT += concurrent CONFIG(static) { DEFINES += QBT_STATIC_QT QTPLUGIN += qico