diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2023-08-16 22:09:57 +0200 |
---|---|---|
committer | Morten Sørvig <morten.sorvig@qt.io> | 2023-09-13 19:51:47 +0200 |
commit | 37dde96e5f1cdf8208b5ab9b4d1edacda416adc3 (patch) | |
tree | a66e7b70c76127eb85fdbd37d76449a366d8a3b3 | |
parent | 8dbc4824895ea9f87d1f6406fe2d22336b6253ed (diff) |
wasm: fix "'QString' is deprecated" warnings
Use the _L1 operator from Qt::Literals::StringLiterals
Pick-to: 6.6
Change-Id: I3d8dc0b7219879a1907e67b539e047ae7f7aae87
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/corelib/platform/wasm/qstdweb.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/corelib/platform/wasm/qstdweb.cpp b/src/corelib/platform/wasm/qstdweb.cpp index b5e7212876..05121ba277 100644 --- a/src/corelib/platform/wasm/qstdweb.cpp +++ b/src/corelib/platform/wasm/qstdweb.cpp @@ -17,6 +17,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::Literals::StringLiterals; + namespace qstdweb { static void usePotentialyUnusedSymbols() @@ -423,7 +425,7 @@ private: QByteArray fileContent(file.size(), Qt::Uninitialized); file.stream(fileContent.data(), [this, itemMimeType, fileContent]() { if (!fileContent.isEmpty()) { - if (itemMimeType.startsWith("image/")) { + if (itemMimeType.startsWith("image/"_L1)) { mimeData->setImageData(imageReader(fileContent)); } else { mimeData->setData(itemMimeType, fileContent.data()); @@ -435,8 +437,8 @@ private: break; } case ItemKind::String: - if (itemMimeType.contains("STRING", Qt::CaseSensitive) - || itemMimeType.contains("TEXT", Qt::CaseSensitive)) { + if (itemMimeType.contains("STRING"_L1, Qt::CaseSensitive) + || itemMimeType.contains("TEXT"_L1, Qt::CaseSensitive)) { break; } QString a; @@ -444,9 +446,9 @@ private: "getData", emscripten::val(itemMimeType.toStdString()))); if (!data.isEmpty()) { - if (itemMimeType == "text/html") + if (itemMimeType == "text/html"_L1) mimeData->setHtml(data); - else if (itemMimeType.isEmpty() || itemMimeType == "text/plain") + else if (itemMimeType.isEmpty() || itemMimeType == "text/plain"_L1) mimeData->setText(data); // the type can be empty else mimeData->setData(itemMimeType, data.toLocal8Bit()); |