mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Fix compiler warnings (Closes #3826).
This commit is contained in:
parent
ef39fb0709
commit
d2f1216987
@ -200,20 +200,20 @@ public:
|
|||||||
if (type_ == QVariant::Invalid)
|
if (type_ == QVariant::Invalid)
|
||||||
type_ = torrent1.toMap().value(key_).type();
|
type_ = torrent1.toMap().value(key_).type();
|
||||||
|
|
||||||
switch (type_) {
|
switch (static_cast<QMetaType::Type>(type_)) {
|
||||||
case QVariant::Int:
|
case QMetaType::Int:
|
||||||
return greaterThan_ ? torrent1.toMap().value(key_).toInt() > torrent2.toMap().value(key_).toInt()
|
return greaterThan_ ? torrent1.toMap().value(key_).toInt() > torrent2.toMap().value(key_).toInt()
|
||||||
: 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()
|
return greaterThan_ ? torrent1.toMap().value(key_).toLongLong() > torrent2.toMap().value(key_).toLongLong()
|
||||||
: 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()
|
return greaterThan_ ? torrent1.toMap().value(key_).toULongLong() > torrent2.toMap().value(key_).toULongLong()
|
||||||
: torrent1.toMap().value(key_).toULongLong() < torrent2.toMap().value(key_).toULongLong();
|
: torrent1.toMap().value(key_).toULongLong() < torrent2.toMap().value(key_).toULongLong();
|
||||||
case QMetaType::Float:
|
case QMetaType::Float:
|
||||||
return greaterThan_ ? torrent1.toMap().value(key_).toFloat() > torrent2.toMap().value(key_).toFloat()
|
return greaterThan_ ? torrent1.toMap().value(key_).toFloat() > torrent2.toMap().value(key_).toFloat()
|
||||||
: 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()
|
return greaterThan_ ? torrent1.toMap().value(key_).toDouble() > torrent2.toMap().value(key_).toDouble()
|
||||||
: torrent1.toMap().value(key_).toDouble() < torrent2.toMap().value(key_).toDouble();
|
: torrent1.toMap().value(key_).toDouble() < torrent2.toMap().value(key_).toDouble();
|
||||||
default:
|
default:
|
||||||
@ -652,15 +652,15 @@ void processMap(QVariantMap prevData, QVariantMap data, QVariantMap &syncData)
|
|||||||
foreach (QString key, data.keys()) {
|
foreach (QString key, data.keys()) {
|
||||||
removedItems.clear();
|
removedItems.clear();
|
||||||
|
|
||||||
switch (data[key].type()) {
|
switch (static_cast<QMetaType::Type>(data[key].type())) {
|
||||||
case QVariant::Map: {
|
case QMetaType::QVariantMap: {
|
||||||
QVariantMap map;
|
QVariantMap map;
|
||||||
processMap(prevData[key].toMap(), data[key].toMap(), map);
|
processMap(prevData[key].toMap(), data[key].toMap(), map);
|
||||||
if (!map.isEmpty())
|
if (!map.isEmpty())
|
||||||
syncData[key] = map;
|
syncData[key] = map;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QVariant::Hash: {
|
case QMetaType::QVariantHash: {
|
||||||
QVariantMap map;
|
QVariantMap map;
|
||||||
processHash(prevData[key].toHash(), data[key].toHash(), map, removedItems);
|
processHash(prevData[key].toHash(), data[key].toHash(), map, removedItems);
|
||||||
if (!map.isEmpty())
|
if (!map.isEmpty())
|
||||||
@ -669,7 +669,7 @@ void processMap(QVariantMap prevData, QVariantMap data, QVariantMap &syncData)
|
|||||||
syncData[key + KEY_SUFFIX_REMOVED] = removedItems;
|
syncData[key + KEY_SUFFIX_REMOVED] = removedItems;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QVariant::List: {
|
case QMetaType::QVariantList: {
|
||||||
QVariantList list;
|
QVariantList list;
|
||||||
processList(prevData[key].toList(), data[key].toList(), list, removedItems);
|
processList(prevData[key].toList(), data[key].toList(), list, removedItems);
|
||||||
if (!list.isEmpty())
|
if (!list.isEmpty())
|
||||||
@ -678,14 +678,14 @@ void processMap(QVariantMap prevData, QVariantMap data, QVariantMap &syncData)
|
|||||||
syncData[key + KEY_SUFFIX_REMOVED] = removedItems;
|
syncData[key + KEY_SUFFIX_REMOVED] = removedItems;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QVariant::String:
|
case QMetaType::QString:
|
||||||
case QVariant::LongLong:
|
case QMetaType::LongLong:
|
||||||
case QMetaType::Float:
|
case QMetaType::Float:
|
||||||
case QVariant::Int:
|
case QMetaType::Int:
|
||||||
case QVariant::Bool:
|
case QMetaType::Bool:
|
||||||
case QVariant::Double:
|
case QMetaType::Double:
|
||||||
case QVariant::ULongLong:
|
case QMetaType::ULongLong:
|
||||||
case QVariant::UInt:
|
case QMetaType::UInt:
|
||||||
if (prevData[key] != data[key])
|
if (prevData[key] != data[key])
|
||||||
syncData[key] = data[key];
|
syncData[key] = data[key];
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user