Port from QLatin1Literal to QLatin1String

QLatin1Literal is an undocumented and deprecated typedef
for QLatin1String, just use the original.

Change-Id: Ib6e2b7ac369be12aed0e455c91cf31b807eae4ed
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Giuseppe D'Angelo 2019-06-11 19:35:19 +02:00
parent bf8862a3bf
commit 05dd00087c
3 changed files with 6 additions and 6 deletions

View File

@ -206,7 +206,7 @@ int qt_v4DebuggerHook(const char *json)
return ProtocolVersion; // Version number.
}
int version = ob.value(QLatin1Literal("version")).toString().toInt();
int version = ob.value(QLatin1String("version")).toString().toInt();
if (version != ProtocolVersion) {
return -WrongProtocol;
}

View File

@ -338,7 +338,7 @@ private:
QQmlType testCaseType;
for (quint32 i = 0, count = compilationUnit->importCount(); i < count; ++i) {
const Import *import = compilationUnit->importAt(i);
if (compilationUnit->stringAt(import->uriIndex) != QLatin1Literal("QtTest"))
if (compilationUnit->stringAt(import->uriIndex) != QLatin1String("QtTest"))
continue;
QString testCaseTypeName(QStringLiteral("TestCase"));
@ -368,7 +368,7 @@ private:
if (result.isTestCase) {
// Look for override of name in this type
for (auto binding = object->bindingsBegin(); binding != object->bindingsEnd(); ++binding) {
if (compilationUnit->stringAt(binding->propertyNameIndex) == QLatin1Literal("name")) {
if (compilationUnit->stringAt(binding->propertyNameIndex) == QLatin1String("name")) {
if (binding->type == QV4::CompiledData::Binding::Type_String) {
result.testCaseName = compilationUnit->stringAt(binding->stringIndex);
} else {
@ -387,10 +387,10 @@ private:
auto functionsEnd = compilationUnit->objectFunctionsEnd(object);
for (auto function = compilationUnit->objectFunctionsBegin(object); function != functionsEnd; ++function) {
QString functionName = compilationUnit->stringAt(function->nameIndex);
if (!(functionName.startsWith(QLatin1Literal("test_")) || functionName.startsWith(QLatin1Literal("benchmark_"))))
if (!(functionName.startsWith(QLatin1String("test_")) || functionName.startsWith(QLatin1String("benchmark_"))))
continue;
if (functionName.endsWith(QLatin1Literal("_data")))
if (functionName.endsWith(QLatin1String("_data")))
continue;
result.testFunctions << functionName;

View File

@ -935,7 +935,7 @@ void tst_qqmlengine::cppSignalAndEval()
{
ObjectCaller objectCaller;
QQmlEngine engine;
engine.rootContext()->setContextProperty(QLatin1Literal("CallerCpp"), &objectCaller);
engine.rootContext()->setContextProperty(QLatin1String("CallerCpp"), &objectCaller);
QQmlComponent c(&engine);
c.setData("import QtQuick 2.9\n"
"Item {\n"