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>
This commit is contained in:
Morten Sørvig 2023-08-16 22:09:57 +02:00
parent 8dbc482489
commit 37dde96e5f

View File

@ -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());