[Gpg4win-commits] [git] Gpg4win - branch, master, updated. gpg4win-2.3.0-118-g6224374

by Andre Heinecke cvs at cvs.gnupg.org
Fri Mar 4 11:48:39 CET 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG for Windows".

The branch, master has been updated
       via  622437410e1a79ec7fe309af8aab78e87a91d778 (commit)
      from  a54a4f665c63615bb748634e2e8391f2639c87e0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 622437410e1a79ec7fe309af8aab78e87a91d778
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Mar 4 11:47:00 2016 +0100

    Fix kleopatra language detection
    
    * Makefile.am (EXTRA_DIST): Add patch.
    * patches/ki18n/0001-Use-QLocale-system-uiLanguages-as-fallback.patch:
     New.
    * src/inst-kleopatra.nsi, src/uninst-kleopatra.nsi: Remove
     klanguageoverrides handling.
    
    --
    The language overrides did not work as they were not read from the
    global folder. This new patch is better. (KDE review 127275)

diff --git a/Makefile.am b/Makefile.am
index 81dbec3..e167793 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,6 +37,7 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/w32pth-2.0.5/workaround-broken-libtool.patch \
         patches/qttools/disable-most-tools.patch \
         patches/ki18n/no-tests.patch \
+        patches/ki18n/0001-Use-QLocale-system-uiLanguages-as-fallback.patch \
         patches/gpgme-1.6.0/0001-w32-Fallback-to-2.1-reg-key-for-gpgconf-search.patch \
         patches/gpgmepp/0002-disable-variants.patch \
         patches/kmime/0001-Check-for-and-replace-strcasestr.patch \
diff --git a/patches/ki18n/0001-Use-QLocale-system-uiLanguages-as-fallback.patch b/patches/ki18n/0001-Use-QLocale-system-uiLanguages-as-fallback.patch
new file mode 100755
index 0000000..7984193
--- /dev/null
+++ b/patches/ki18n/0001-Use-QLocale-system-uiLanguages-as-fallback.patch
@@ -0,0 +1,100 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 7a2c71e618d97f5d4a3bdf1ba10fc36c638f17ba Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke at intevation.de>
+Date: Fri, 4 Mar 2016 11:26:06 +0100
+Subject: [PATCH] Use QLocale::system uiLanguages as fallback
+
+This fixes locale initialisation on platforms that don't use
+environment variables for language settings. (Windows)
+---
+ src/klocalizedstring.cpp | 54 ++++++++++++++++++++++++++++++------------------
+ 1 file changed, 34 insertions(+), 20 deletions(-)
+
+diff --git a/src/klocalizedstring.cpp b/src/klocalizedstring.cpp
+index b24fe9b..e1f71dd 100644
+--- a/src/klocalizedstring.cpp
++++ b/src/klocalizedstring.cpp
+@@ -95,6 +95,30 @@ static void splitLocale(const QString &aLocale,
+     language = locale;
+ }
+
++static void appendLocaleString(QStringList &languages, const QString &value)
++{
++    // Process the value to create possible combinations.
++    QString language, country, modifier, charset;
++    splitLocale(value, language, country, modifier, charset);
++
++    if (!country.isEmpty() && !modifier.isEmpty()) {
++        languages +=   language + QLatin1Char('_')
++                       + country + QLatin1Char('@')
++                       + modifier;
++    }
++    // NOTE: Priority is unclear in case both the country and
++    // the modifier are present. Should really language at modifier be of
++    // higher priority than language_country?
++    // In at least one case (Serbian language), it is better this way.
++    if (!modifier.isEmpty()) {
++        languages += language + QLatin1Char('@') + modifier;
++    }
++    if (!country.isEmpty()) {
++        languages += language + QLatin1Char('_') + country;
++    }
++    languages += language;
++}
++
+ static void appendLanguagesFromVariable(QStringList &languages,
+                                         const char *envar, bool isList = false)
+ {
+@@ -104,30 +128,19 @@ static void appendLanguagesFromVariable(QStringList &languages,
+         if (isList) {
+             languages += value.split(QLatin1Char(':'));
+         } else {
+-            // Process the value to create possible combinations.
+-            QString language, country, modifier, charset;
+-            splitLocale(value, language, country, modifier, charset);
+-
+-            if (!country.isEmpty() && !modifier.isEmpty()) {
+-                languages +=   language + QLatin1Char('_')
+-                               + country + QLatin1Char('@')
+-                               + modifier;
+-            }
+-            // NOTE: Priority is unclear in case both the country and
+-            // the modifier are present. Should really language at modifier be of
+-            // higher priority than language_country?
+-            // In at least one case (Serbian language), it is better this way.
+-            if (!modifier.isEmpty()) {
+-                languages += language + QLatin1Char('@') + modifier;
+-            }
+-            if (!country.isEmpty()) {
+-                languages += language + QLatin1Char('_') + country;
+-            }
+-            languages += language;
++            appendLocaleString(languages, value);
+         }
+     }
+ }
+
++static void appendLanguagesFromQLocale(QStringList &languages, const QLocale &locale)
++{
++    const QStringList uiLangs = locale.uiLanguages();
++    Q_FOREACH (QString value, uiLangs) {
++        appendLocaleString(languages, value.replace(QLatin1Char('-'), QLatin1Char('_')));
++    }
++}
++
+ // Extract the first country code from a list of language_COUNTRY strings.
+ // Country code is converted to all lower case letters.
+ static QString extractCountry(const QStringList &languages)
+@@ -333,6 +346,7 @@ void KLocalizedStringPrivateStatics::initializeLocaleLanguages()
+     appendLanguagesFromVariable(localeLanguages, "LC_ALL");
+     appendLanguagesFromVariable(localeLanguages, "LC_MESSAGES");
+     appendLanguagesFromVariable(localeLanguages, "LANG");
++    appendLanguagesFromQLocale(localeLanguages, QLocale::system());
+ }
+
+ KLocalizedString::KLocalizedString()
+--
+2.1.4
diff --git a/src/inst-kleopatra.nsi b/src/inst-kleopatra.nsi
index 0c48dc0..b84b029 100644
--- a/src/inst-kleopatra.nsi
+++ b/src/inst-kleopatra.nsi
@@ -214,59 +214,6 @@ ${MementoSection} "Kleopatra" SEC_kleopatra
   FileClose $1
   pop $1
 
-  push $1
-  FileOpen $1 "$INSTDIR\share\klanguageoverridesrc" "w"
-  FileWrite $1 '[Language] $\r$\n'
-  StrCmp $LANGUAGE "1031" german_locale 0
-  StrCmp $LANGUAGE "1025" arabic 0
-  StrCmp $LANGUAGE "1029" czech 0
-  StrCmp $LANGUAGE "1049" russian 0
-  StrCmp $LANGUAGE "1036" french 0
-  StrCmp $LANGUAGE "1034" spanish 0
-  StrCmp $LANGUAGE "1040" italian 0
-  StrCmp $LANGUAGE "1046" portugese 0
-  StrCmp $LANGUAGE "2070" portugese_br 0
-  StrCmp $LANGUAGE "2052" simpchinese 0
-  StrCmp $LANGUAGE "1028" tradchinese 0
-  FileWrite $1 'kleopatra=@ByteArray(en) $\r$\n'
-  Goto lang_done
-german_locale:
-  FileWrite $1 'kleopatra=@ByteArray(de) $\r$\n'
-  Goto lang_done
-arabic:
-  FileWrite $1 'kleopatra=@ByteArray(ar) $\r$\n'
-  Goto lang_done
-czech:
-  FileWrite $1 'kleopatra=@ByteArray(cs) $\r$\n'
-  Goto lang_done
-russian:
-  FileWrite $1 'kleopatra=@ByteArray(ru) $\r$\n'
-  Goto lang_done
-french:
-  FileWrite $1 'kleopatra=@ByteArray(fr) $\r$\n'
-  Goto lang_done
-spanish:
-  FileWrite $1 'kleopatra=@ByteArray(es) $\r$\n'
-  Goto lang_done
-italian:
-  FileWrite $1 'kleopatra=@ByteArray(it) $\r$\n'
-  Goto lang_done
-portugese:
-  FileWrite $1 'kleopatra=@ByteArray(pt) $\r$\n'
-  Goto lang_done
-portugese_br:
-  FileWrite $1 'kleopatra=@ByteArray(pt_BR) $\r$\n'
-  Goto lang_done
-simpchinese:
-  FileWrite $1 'kleopatra=@ByteArray(zh_CN) $\r$\n'
-  Goto lang_done
-tradchinese:
-  FileWrite $1 'kleopatra=@ByteArray(zh_TW) $\r$\n'
-  Goto lang_done
-lang_done:
-  FileClose $1
-  pop $1
-
   SetOutPath "$INSTDIR\share\QtProject"
   # We want kleopatra logging for debugging
   push $1
diff --git a/src/uninst-kleopatra.nsi b/src/uninst-kleopatra.nsi
index 7c3a04d..374c348 100644
--- a/src/uninst-kleopatra.nsi
+++ b/src/uninst-kleopatra.nsi
@@ -175,7 +175,6 @@ Section "-un.kleopatra"
   RmDir "$INSTDIR\share\kservices5\"
 
   Delete "$INSTDIR\share\kdeglobals"
-  Delete "$INSTDIR\share\klanguageoverridesrc"
   Delete "$INSTDIR\share\QtProject\qtlogging.ini"
 #  Delete "$INSTDIR\share\apps\kwatchgnupg\pics\kwatchgnupg2.png"
 #  Delete "$INSTDIR\share\apps\kwatchgnupg\pics\kwatchgnupg.png"

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                                        |   1 +
 ...se-QLocale-system-uiLanguages-as-fallback.patch | 100 +++++++++++++++++++++
 src/inst-kleopatra.nsi                             |  53 -----------
 src/uninst-kleopatra.nsi                           |   1 -
 4 files changed, 101 insertions(+), 54 deletions(-)
 create mode 100755 patches/ki18n/0001-Use-QLocale-system-uiLanguages-as-fallback.patch


hooks/post-receive
-- 
GnuPG for Windows
http://git.gnupg.org



More information about the Gpg4win-commits mailing list