Package: quassel / 1:0.13.1-5

qt514/0003-qa-Replace-deprecated-qVariantFromValue-by-QVariant-.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
From 1f21c1f9613031ae263eeed0c4883bfcd5488343 Mon Sep 17 00:00:00 2001
From: Manuel Nickschas <sputnick@quassel-irc.org>
Date: Tue, 7 Jan 2020 19:25:38 +0100
Subject: [PATCH 3/6] qa: Replace deprecated qVariantFromValue() by
 QVariant::fromValue()
Bug: https://bugs.quassel-irc.org/issues/1544
Bug-Ubuntu: https://bugs.launchpad.net/quassel/+bug/1885436
Origin: upstream, https://github.com/quassel/quassel/pull/518
Origin: upstream, https://github.com/quassel/quassel/commit/1f21c1f9613031ae263eeed0c4883bfcd5488343

Deprecated since Qt 5.14.
---
 src/client/clientsettings.cpp                     | 4 ++--
 src/common/bufferviewconfig.cpp                   | 6 +++---
 src/core/coreirclisthelper.cpp                    | 2 +-
 src/core/coreusersettings.cpp                     | 2 +-
 src/qtui/settingspages/bufferviewsettingspage.cpp | 6 +++---
 5 files changed, 10 insertions(+), 10 deletions(-)

--- a/src/client/clientsettings.cpp
+++ b/src/client/clientsettings.cpp
@@ -182,7 +182,7 @@ void CoreAccountSettings::setJumpKeyMap(
     QVariantMap variants;
     QHash<int, BufferId>::const_iterator mapIter = keyMap.constBegin();
     while (mapIter != keyMap.constEnd()) {
-        variants[QString::number(mapIter.key())] = qVariantFromValue(mapIter.value());
+        variants[QString::number(mapIter.key())] = QVariant::fromValue(mapIter.value());
         ++mapIter;
     }
     setAccountValue("JumpKeyMap", variants);
@@ -205,8 +205,8 @@ QHash<int, BufferId> CoreAccountSettings
 void CoreAccountSettings::setBufferViewOverlay(const QSet<int> &viewIds)
 {
     QVariantList variants;
-    foreach(int viewId, viewIds) {
-        variants << qVariantFromValue(viewId);
+    foreach (int viewId, viewIds) {
+        variants << QVariant::fromValue(viewId);
     }
     setAccountValue("BufferViewOverlay", variants);
 }
--- a/src/common/bufferviewconfig.cpp
+++ b/src/common/bufferviewconfig.cpp
@@ -150,8 +150,8 @@ QVariantList BufferViewConfig::initBuffe
 {
     QVariantList buffers;
 
-    foreach(BufferId bufferId, _buffers) {
-        buffers << qVariantFromValue(bufferId);
+    foreach (BufferId bufferId, _buffers) {
+        buffers << QVariant::fromValue(bufferId);
     }
 
     return buffers;
@@ -186,8 +186,8 @@ QVariantList BufferViewConfig::initRemov
 {
     QVariantList removedBuffers;
 
-    foreach(BufferId bufferId, _removedBuffers) {
-        removedBuffers << qVariantFromValue(bufferId);
+    foreach (BufferId bufferId, _removedBuffers) {
+        removedBuffers << QVariant::fromValue(bufferId);
     }
 
     return removedBuffers;
@@ -208,8 +208,8 @@ QVariantList BufferViewConfig::initTempo
 {
     QVariantList temporarilyRemovedBuffers;
 
-    foreach(BufferId bufferId, _temporarilyRemovedBuffers) {
-        temporarilyRemovedBuffers << qVariantFromValue(bufferId);
+    foreach (BufferId bufferId, _temporarilyRemovedBuffers) {
+        temporarilyRemovedBuffers << QVariant::fromValue(bufferId);
     }
 
     return temporarilyRemovedBuffers;
--- a/src/core/coreirclisthelper.cpp
+++ b/src/core/coreirclisthelper.cpp
@@ -90,10 +90,8 @@ bool CoreIrcListHelper::endOfChannelList
         QVariantList channelList;
         foreach(ChannelDescription channel, _channelLists[netId]) {
             QVariantList channelVariant;
-            channelVariant << channel.channelName
-                           << channel.userCount
-                           << channel.topic;
-            channelList << qVariantFromValue<QVariant>(channelVariant);
+            channelVariant << channel.channelName << channel.userCount << channel.topic;
+            channelList << QVariant::fromValue<QVariant>(channelVariant);
         }
         _finishedChannelLists[netId] = channelList;
         _channelLists.remove(netId);
--- a/src/core/coreusersettings.cpp
+++ b/src/core/coreusersettings.cpp
@@ -47,7 +47,7 @@ QList<IdentityId> CoreUserSettings::iden
 
 void CoreUserSettings::storeIdentity(const Identity &identity)
 {
-    setLocalValue(QString("Identities/%1").arg(identity.id().toInt()), qVariantFromValue(identity));
+    setLocalValue(QString("Identities/%1").arg(identity.id().toInt()), QVariant::fromValue(identity));
 }
 
 
--- a/src/qtui/settingspages/bufferviewsettingspage.cpp
+++ b/src/qtui/settingspages/bufferviewsettingspage.cpp
@@ -127,12 +127,12 @@ void BufferViewSettingsPage::load()
     // load network selector
     ui.networkSelector->clear();
     ui.networkSelector->addItem(tr("All"));
-    ui.networkSelector->setItemData(0, qVariantFromValue<NetworkId>(NetworkId()));
-    const Network *net;
-    foreach(NetworkId netId, Client::networkIds()) {
+    ui.networkSelector->setItemData(0, QVariant::fromValue(NetworkId()));
+    const Network* net;
+    foreach (NetworkId netId, Client::networkIds()) {
         net = Client::network(netId);
         ui.networkSelector->addItem(net->networkName());
-        ui.networkSelector->setItemData(ui.networkSelector->count() - 1, qVariantFromValue<NetworkId>(net->networkId()));
+        ui.networkSelector->setItemData(ui.networkSelector->count() - 1, QVariant::fromValue(net->networkId()));
     }
     _ignoreWidgetChanges = false;
 
@@ -207,7 +207,7 @@ void BufferViewSettingsPage::coreConnect
 void BufferViewSettingsPage::addBufferView(BufferViewConfig *config)
 {
     QListWidgetItem *item = new QListWidgetItem(config->bufferViewName(), ui.bufferViewList);
-    item->setData(Qt::UserRole, qVariantFromValue<QObject *>(qobject_cast<QObject *>(config)));
+    item->setData(Qt::UserRole, QVariant::fromValue(qobject_cast<QObject*>(config)));
     connect(config, SIGNAL(updatedRemotely()), this, SLOT(updateBufferView()));
     connect(config, SIGNAL(destroyed()), this, SLOT(bufferViewDeleted()));
     ui.deleteBufferView->setEnabled(ui.bufferViewList->count() > 1);