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();
|
data = textDocument->plainText();
|
||||||
} else {
|
} else {
|
||||||
const QVariant textV = document->property("plainText"); // Diff Editor.
|
const QVariant textV = document->property("plainText"); // Diff Editor.
|
||||||
if (textV.type() == QVariant::String)
|
if (textV.typeId() == QMetaType::QString)
|
||||||
data = textV.toString();
|
data = textV.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
|
|||||||
std::cout << qPrintable(argsCollector.usageString()) << std::endl;
|
std::cout << qPrintable(argsCollector.usageString()) << std::endl;
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
case ArgumentsCollector::RequestTypeListProtocols:
|
case ArgumentsCollector::RequestTypeListProtocols:
|
||||||
foreach (const QString &protocol, protocols)
|
for (const QString &protocol : protocols)
|
||||||
std::cout << qPrintable(protocol) << std::endl;
|
std::cout << qPrintable(protocol) << std::endl;
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
case ArgumentsCollector::RequestTypePaste: {
|
case ArgumentsCollector::RequestTypePaste: {
|
||||||
|
@@ -245,8 +245,8 @@ static inline QStringList parseList(QIODevice *device)
|
|||||||
if (obj.contains(pastesKey)) {
|
if (obj.contains(pastesKey)) {
|
||||||
value = obj.value(pastesKey);
|
value = obj.value(pastesKey);
|
||||||
if (value.isArray()) {
|
if (value.isArray()) {
|
||||||
QJsonArray array = value.toArray();
|
const QJsonArray array = value.toArray();
|
||||||
foreach (const QJsonValue &val, array)
|
for (const QJsonValue &val : array)
|
||||||
result.append(val.toString());
|
result.append(val.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user