mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-29 11:48:05 -06:00
Drop support of Qt 5
Also remove usage of some deprecated stuff. PR #19338.
This commit is contained in:
committed by
GitHub
parent
5e610cfdcf
commit
dbe79484d2
@@ -186,7 +186,7 @@ namespace
|
||||
const QVariant &value = i.value();
|
||||
QVariantList removedItems;
|
||||
|
||||
switch (static_cast<QMetaType::Type>(value.type()))
|
||||
switch (value.userType())
|
||||
{
|
||||
case QMetaType::QVariantMap:
|
||||
{
|
||||
@@ -232,7 +232,7 @@ namespace
|
||||
default:
|
||||
Q_ASSERT_X(false, "processMap"
|
||||
, u"Unexpected type: %1"_s
|
||||
.arg(QString::fromLatin1(QMetaType::typeName(static_cast<QMetaType::Type>(value.type()))))
|
||||
.arg(QString::fromLatin1(value.metaType().name()))
|
||||
.toUtf8().constData());
|
||||
}
|
||||
}
|
||||
@@ -257,9 +257,9 @@ namespace
|
||||
{
|
||||
for (auto i = data.cbegin(); i != data.cend(); ++i)
|
||||
{
|
||||
switch (i.value().type())
|
||||
switch (i.value().userType())
|
||||
{
|
||||
case QVariant::Map:
|
||||
case QMetaType::QVariantMap:
|
||||
if (!prevData.contains(i.key()))
|
||||
{
|
||||
// new list item found - append it to syncData
|
||||
@@ -278,7 +278,7 @@ namespace
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QVariant::StringList:
|
||||
case QMetaType::QStringList:
|
||||
if (!prevData.contains(i.key()))
|
||||
{
|
||||
// new list item found - append it to syncData
|
||||
|
||||
@@ -302,9 +302,9 @@ void TorrentsController::infoAction()
|
||||
|
||||
const auto lessThan = [](const QVariant &left, const QVariant &right) -> bool
|
||||
{
|
||||
Q_ASSERT(left.type() == right.type());
|
||||
Q_ASSERT(left.userType() == right.userType());
|
||||
|
||||
switch (static_cast<QMetaType::Type>(left.type()))
|
||||
switch (left.userType())
|
||||
{
|
||||
case QMetaType::Bool:
|
||||
return left.value<bool>() < right.value<bool>();
|
||||
@@ -319,8 +319,8 @@ void TorrentsController::infoAction()
|
||||
case QMetaType::QString:
|
||||
return left.value<QString>() < right.value<QString>();
|
||||
default:
|
||||
qWarning("Unhandled QVariant comparison, type: %d, name: %s", left.type()
|
||||
, QMetaType::typeName(left.type()));
|
||||
qWarning("Unhandled QVariant comparison, type: %d, name: %s"
|
||||
, left.userType(), left.metaType().name());
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user