From b8f732a65ef95406780d43ba2c0245728e342347 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Mon, 23 Apr 2012 20:22:22 -0700 Subject: [PATCH] Using QStringLiteral or QLatin1String instead of QLatin1Literal Change-Id: Ie1435f1ac5c81d8781e7118121ed07c7202ab124 Reviewed-by: Olivier Goffart Reviewed-by: Lars Knoll --- src/quick/items/context2d/qquickcanvasitem.cpp | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 571b4b0..a562292 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -918,27 +918,27 @@ QString QQuickCanvasItem::toDataURL(const QString& mimeType) const buffer.open(QIODevice::WriteOnly); QString mime = mimeType.toLower(); QString type; - if (mime == QLatin1Literal("image/png")) { - type = QLatin1Literal("PNG"); - } else if (mime == QLatin1Literal("image/bmp")) - type = QLatin1Literal("BMP"); - else if (mime == QLatin1Literal("image/jpeg")) - type = QLatin1Literal("JPEG"); - else if (mime == QLatin1Literal("image/x-portable-pixmap")) - type = QLatin1Literal("PPM"); - else if (mime == QLatin1Literal("image/tiff")) - type = QLatin1Literal("TIFF"); - else if (mime == QLatin1Literal("image/xpm")) - type = QLatin1Literal("XPM"); + if (mime == QLatin1String("image/png")) { + type = QStringLiteral("PNG"); + } else if (mime == QLatin1String("image/bmp")) + type = QStringLiteral("BMP"); + else if (mime == QLatin1String("image/jpeg")) + type = QStringLiteral("JPEG"); + else if (mime == QLatin1String("image/x-portable-pixmap")) + type = QStringLiteral("PPM"); + else if (mime == QLatin1String("image/tiff")) + type = QStringLiteral("TIFF"); + else if (mime == QLatin1String("image/xpm")) + type = QStringLiteral("XPM"); else - return QLatin1Literal("data:,"); + return QStringLiteral("data:,"); image.save(&buffer, type.toLatin1()); buffer.close(); - QString dataUrl = QLatin1Literal("data:%1;base64,%2"); + QString dataUrl = QStringLiteral("data:%1;base64,%2"); return dataUrl.arg(mime).arg(QLatin1String(ba.toBase64().constData())); } - return QLatin1Literal("data:,"); + return QStringLiteral("data:,"); } void QQuickCanvasItem::delayedCreate() -- 2.7.4