diff options
author | Edward Welbourne <[email protected]> | 2025-01-16 14:35:17 +0100 |
---|---|---|
committer | Edward Welbourne <[email protected]> | 2025-01-20 22:03:50 +0100 |
commit | 9574e8cbef06b3b55d1f651b09d134aef7150aba (patch) | |
tree | c68d2cd027a3e725ea513b4bcac9da78126f0e29 | |
parent | bc733ea787ad6993e945146a9d297d14cb6175ac (diff) |
QMimeType::comments(): skip locale-name-trimming
Pruning the part of a locale name after the first '_' should now be
redundant, as QLocale::uiLanguages() now includes the resulting
truncations. It may do so later in the sequence than the pruning used
here, where the pruned version either might be a bad choice (due to
being in a script incompatible with what we started on, e.g. pruning
pa_PK to pa, which uses a different script) or would also arise from
some later, more specific, entry (as when uiLanguages() is expanded
from {en_NL, en_150}, where checking en immediately after en_NL would
bypass the more specific en_150 when present).
Pick-to: 6.9
Change-Id: I4c7c199ca16a8e4803843547c5a689cea11af1f2
Reviewed-by: Thiago Macieira <[email protected]>
-rw-r--r-- | src/corelib/mimetypes/qmimetype.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp index 31622a21e73..2c23f3175db 100644 --- a/src/corelib/mimetypes/qmimetype.cpp +++ b/src/corelib/mimetypes/qmimetype.cpp @@ -213,13 +213,6 @@ QString QMimeType::comment() const QString comm = localeComments.value(lang); if (!comm.isEmpty()) return comm; - const qsizetype cut = lang.indexOf(u'_'); - // If "de_CH" is missing, check for "de" (and similar): - if (cut != -1) { - comm = localeComments.value(lang.left(cut)); - if (!comm.isEmpty()) - return comm; - } } // Use the mimetype name as fallback |