aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpaster
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2022-08-04 07:04:38 +0200
committerChristian Stenger <christian.stenger@qt.io>2022-08-04 05:54:07 +0000
commitd24dd977178b04ba9dd8d1b5e13877c1fbe58545 (patch)
treea662c1f71407a6e2657ace9b266c17c4058b79ec /src/plugins/cpaster
parenta714ddf59fdb9b74af8d9b8158a421605dab6179 (diff)
CPaster: Replace deprecated code
Change-Id: I2c9ee3df6c4a8e91d5f3701655e10dc106697593 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/cpaster')
-rw-r--r--src/plugins/cpaster/cpasterplugin.cpp2
-rw-r--r--src/plugins/cpaster/frontend/main.cpp2
-rw-r--r--src/plugins/cpaster/stickynotespasteprotocol.cpp4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp
index a119c9ce07..2813203709 100644
--- a/src/plugins/cpaster/cpasterplugin.cpp
+++ b/src/plugins/cpaster/cpasterplugin.cpp
@@ -219,7 +219,7 @@ static inline void textFromCurrentEditor(QString *text, QString *mimeType)
data = textDocument->plainText();
} else {
const QVariant textV = document->property("plainText"); // Diff Editor.
- if (textV.type() == QVariant::String)
+ if (textV.typeId() == QMetaType::QString)
data = textV.toString();
}
}
diff --git a/src/plugins/cpaster/frontend/main.cpp b/src/plugins/cpaster/frontend/main.cpp
index b2aba50ac3..471d864623 100644
--- a/src/plugins/cpaster/frontend/main.cpp
+++ b/src/plugins/cpaster/frontend/main.cpp
@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
std::cout << qPrintable(argsCollector.usageString()) << std::endl;
return EXIT_SUCCESS;
case ArgumentsCollector::RequestTypeListProtocols:
- foreach (const QString &protocol, protocols)
+ for (const QString &protocol : protocols)
std::cout << qPrintable(protocol) << std::endl;
return EXIT_SUCCESS;
case ArgumentsCollector::RequestTypePaste: {
diff --git a/src/plugins/cpaster/stickynotespasteprotocol.cpp b/src/plugins/cpaster/stickynotespasteprotocol.cpp
index a3b5a7473f..6524a2cc43 100644
--- a/src/plugins/cpaster/stickynotespasteprotocol.cpp
+++ b/src/plugins/cpaster/stickynotespasteprotocol.cpp
@@ -245,8 +245,8 @@ static inline QStringList parseList(QIODevice *device)
if (obj.contains(pastesKey)) {
value = obj.value(pastesKey);
if (value.isArray()) {
- QJsonArray array = value.toArray();
- foreach (const QJsonValue &val, array)
+ const QJsonArray array = value.toArray();
+ for (const QJsonValue &val : array)
result.append(val.toString());
}
}