From ceaa7d6341e666f6fe0d071ea34cad9877961a0e Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Wed, 13 Apr 2022 11:42:38 +0200 Subject: Plugins: use _L1 for for creating Latin-1 string literals As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Task-number: QTBUG-98434 Change-Id: I7fadd3cf27ad099028d70f05956303e3af62c0f5 Reviewed-by: Marc Mutz --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.cpp') diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index ec0a504577..fa24c734cf 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -79,6 +79,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + #ifndef QT_NO_DEBUG_STREAM /* Output UID (IID, CLSID) as C++ constants. * The constants are contained in the Windows SDK libs, but not for MinGW. */ @@ -666,13 +668,13 @@ QWindowsShellItem::IShellItems QWindowsShellItem::itemsFromItemArray(IShellItemA bool QWindowsShellItem::copyData(QIODevice *out, QString *errorMessage) { if (!canStream()) { - *errorMessage = QLatin1String("Item not streamable"); + *errorMessage = "Item not streamable"_L1; return false; } IStream *istream = nullptr; HRESULT hr = m_item->BindToHandler(nullptr, BHID_Stream, IID_PPV_ARGS(&istream)); if (FAILED(hr)) { - *errorMessage = QLatin1String("BindToHandler() failed: ") + *errorMessage = "BindToHandler() failed: "_L1 + QLatin1String(QWindowsContext::comErrorString(hr)); return false; } @@ -689,7 +691,7 @@ bool QWindowsShellItem::copyData(QIODevice *out, QString *errorMessage) } istream->Release(); if (hr != S_OK && hr != S_FALSE) { - *errorMessage = QLatin1String("Read() failed: ") + *errorMessage = "Read() failed: "_L1 + QLatin1String(QWindowsContext::comErrorString(hr)); return false; } @@ -1439,14 +1441,14 @@ QString tempFilePattern(QString name) static QString createTemporaryItemCopy(QWindowsShellItem &qItem, QString *errorMessage) { if (!qItem.canStream()) { - *errorMessage = QLatin1String("Item not streamable"); + *errorMessage = "Item not streamable"_L1; return QString(); } QTemporaryFile targetFile(tempFilePattern(qItem.normalDisplay())); targetFile.setAutoRemove(false); if (!targetFile.open()) { - *errorMessage = QLatin1String("Cannot create temporary file: ") + *errorMessage = "Cannot create temporary file: "_L1 + targetFile.errorString(); return QString(); } -- cgit v1.2.3