From 55e6b1b591fab292309d72a1110f885078ca1911 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 20 Jun 2023 02:56:18 +0300 Subject: [PATCH] kio: remove redundant languages overrides the languages are BCP 47 codes, see: https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.5 and the links that lead to the BCP 47 RFC. the replacements in the provided file were kinda bogus (contain dash which they should not) Signed-off-by: Ivailo Monev --- kio/CMakeLists.txt | 7 ------- kio/kio/accept-languages.codes | 6 ------ kio/kio/kprotocolmanager.cpp | 16 +--------------- 3 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 kio/kio/accept-languages.codes diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt index d7025234..0b7e388c 100644 --- a/kio/CMakeLists.txt +++ b/kio/CMakeLists.txt @@ -261,13 +261,6 @@ install( DESTINATION ${KDE4_DBUS_INTERFACES_INSTALL_DIR} ) - -install( - FILES - kio/accept-languages.codes - DESTINATION ${KDE4_CONFIG_INSTALL_DIR} -) - install( FILES kfile/images/yes.png diff --git a/kio/kio/accept-languages.codes b/kio/kio/accept-languages.codes deleted file mode 100644 index 10d9bf06..00000000 --- a/kio/kio/accept-languages.codes +++ /dev/null @@ -1,6 +0,0 @@ -[ReplacementCodes] -nb=nb,no -nn=nn,no -sr@latin=sr-Latn,sr -sr=sr-Cyrl,sr -pt_BR=pt-BR,pt diff --git a/kio/kio/kprotocolmanager.cpp b/kio/kio/kprotocolmanager.cpp index 3bceb6f0..eedb5546 100644 --- a/kio/kio/kprotocolmanager.cpp +++ b/kio/kio/kprotocolmanager.cpp @@ -622,27 +622,13 @@ QString KProtocolManager::acceptLanguagesHeader() if (!languageList.contains(english)) languageList += english; - // Some languages may have web codes different from locale codes, - // read them from the config and insert in proper order. - KConfig acclangConf("accept-languages.codes", KConfig::NoGlobals); - KConfigGroup replacementCodes(&acclangConf, "ReplacementCodes"); - QStringList languageListFinal; - Q_FOREACH (const QString &lang, languageList) - { - const QStringList langs = replacementCodes.readEntry(lang, QStringList()); - if (langs.isEmpty()) - languageListFinal += lang; - else - languageListFinal += langs; - } - // The header is composed of comma separated languages, with an optional // associated priority estimate (q=1..0) defaulting to 1. // As our language tags are already sorted by priority, we'll just decrease // the value evenly int prio = 10; QString header; - Q_FOREACH (const QString &lang,languageListFinal) { + Q_FOREACH (const QString &lang,languageList) { header += lang; if (prio < 10) { header += QL1S(";q=0.");