forked from qt-creator/qt-creator
CPaster: Replace deprecated code
Change-Id: I2c9ee3df6c4a8e91d5f3701655e10dc106697593 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -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: {
|
||||
|
@@ -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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user