diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-08-25 15:04:31 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-05 02:03:58 +0200 |
commit | 403b01f86682b9b0b1cd271dbf421da949a2f0ad (patch) | |
tree | 86256a6e05ec96b7b23615b7ccbc4590edc78329 /src/gui/image | |
parent | 455d811b5803abc12ad66529ca27579f4a6b6774 (diff) |
Change translation context of strings to new class
The strings were in QFileDialog context even though they were in
QFileIconProvider, probably for historical reasons.
Now that the strings have been moved into QtGui, using a QtWidgets class
as the context makes no sense.
Change-Id: Ia4f3bd18abaab2a5fbbb94e945782f4d2d94e7d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qabstractfileiconprovider.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/gui/image/qabstractfileiconprovider.cpp b/src/gui/image/qabstractfileiconprovider.cpp index 7872aed4d5..51638f69d8 100644 --- a/src/gui/image/qabstractfileiconprovider.cpp +++ b/src/gui/image/qabstractfileiconprovider.cpp @@ -184,15 +184,8 @@ QIcon QAbstractFileIconProvider::icon(const QFileInfo &info) const QString QAbstractFileIconProvider::type(const QFileInfo &info) const { Q_D(const QAbstractFileIconProvider); - /* ### Qt 6 These string translations being in the QFileDialog context is not ideal, - but translating them in QFileDialog context only in the QFileIconProvider subclass - isn't either (it basically requires a duplication of the entire function). - Either we change it to QAbstractFileIconProvider context (invalidates existing - translations, but that's probably ok), or make a runtime lookup and use QFileDIalog - context only if QGuiApplication is a QApplication. - */ if (QFileSystemEntry::isRootPath(info.absoluteFilePath())) - return QGuiApplication::translate("QFileDialog", "Drive"); + return QGuiApplication::translate("QAbstractFileIconProvider", "Drive"); if (info.isFile()) { const QMimeType mimeType = d->mimeDatabase.mimeTypeForFile(info); return mimeType.comment().isEmpty() ? mimeType.name() : mimeType.comment(); @@ -200,9 +193,9 @@ QString QAbstractFileIconProvider::type(const QFileInfo &info) const if (info.isDir()) #ifdef Q_OS_WIN - return QGuiApplication::translate("QFileDialog", "File Folder", "Match Windows Explorer"); + return QGuiApplication::translate("QAbstractFileIconProvider", "File Folder", "Match Windows Explorer"); #else - return QGuiApplication::translate("QFileDialog", "Folder", "All other platforms"); + return QGuiApplication::translate("QAbstractFileIconProvider", "Folder", "All other platforms"); #endif // Windows - "File Folder" // macOS - "Folder" @@ -211,16 +204,16 @@ QString QAbstractFileIconProvider::type(const QFileInfo &info) const if (info.isSymLink()) #ifdef Q_OS_MACOS - return QGuiApplication::translate("QFileDialog", "Alias", "macOS Finder"); + return QGuiApplication::translate("QAbstractFileIconProvider", "Alias", "macOS Finder"); #else - return QGuiApplication::translate("QFileDialog", "Shortcut", "All other platforms"); + return QGuiApplication::translate("QAbstractFileIconProvider", "Shortcut", "All other platforms"); #endif // macOS - "Alias" // Windows - "Shortcut" // Konqueror - "Folder" or "TXT File" i.e. what it is pointing to // Nautilus - "link to folder" or "link to object file", same as Konqueror - return QGuiApplication::translate("QFileDialog", "Unknown"); + return QGuiApplication::translate("QAbstractFileIconProvider", "Unknown"); } QT_END_NAMESPACE |