diff options
author | Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> | 2009-03-11 14:47:59 +0000 |
---|---|---|
committer | Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> | 2009-03-11 14:47:59 +0000 |
commit | 39eb652492ccecbdb76df3c87b405d6e9d0353bb (patch) | |
tree | bed827e9470a07843a589d30f3e78d211234eb10 /kde-base/kdelibs/files | |
parent | ops (diff) | |
download | gentoo-2-39eb652492ccecbdb76df3c87b405d6e9d0353bb.tar.gz gentoo-2-39eb652492ccecbdb76df3c87b405d6e9d0353bb.tar.bz2 gentoo-2-39eb652492ccecbdb76df3c87b405d6e9d0353bb.zip |
Added ${FILESDIR}/${P}-kcatalog.patch and bumped to kdelibs-4.2.1-r2 to fix remaining issues on upstream bug 186038 and Gentoo bug 261367 related to gwenview.
(Portage version: 2.2_rc24/cvs/Linux x86_64)
Diffstat (limited to 'kde-base/kdelibs/files')
-rw-r--r-- | kde-base/kdelibs/files/kdelibs-4.2.1-kcatalog.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/kde-base/kdelibs/files/kdelibs-4.2.1-kcatalog.patch b/kde-base/kdelibs/files/kdelibs-4.2.1-kcatalog.patch new file mode 100644 index 000000000000..40d4884645ae --- /dev/null +++ b/kde-base/kdelibs/files/kdelibs-4.2.1-kcatalog.patch @@ -0,0 +1,59 @@ +Index: kcatalog.cpp +=================================================================== +--- kcatalog.cpp (revision 938013) ++++ kcatalog.cpp (working copy) +@@ -30,6 +30,24 @@ + #include <locale.h> + #include "gettext.h" + ++ ++static bool s_localeSet = false; ++ ++// Initialize the locale very early during application startup ++// This is necessary for e.g. toLocal8Bit() to work, even before ++// a Q[Core]Application exists (David) ++int kInitializeLocale() ++{ ++ setlocale(LC_ALL, ""); ++#if QT_VERSION >= 0x040500 ++ extern Q_CORE_EXPORT bool qt_locale_initialized; // in Qt since 4.5.0 ++ qt_locale_initialized = true; // as recommended by Thiago ++#endif ++ s_localeSet = true; ++ return 1; ++} ++Q_CONSTRUCTOR_FUNCTION(kInitializeLocale) ++ + // not defined on win32 :( + #ifdef _WIN32 + # ifndef LC_MESSAGES +@@ -50,7 +68,6 @@ + + QByteArray systemLanguage; + +- static int localeSet; + static QByteArray currentLanguage; + + void setupGettextEnv (); +@@ -62,17 +79,15 @@ + return debug << c.d->language << " " << c.d->name << " " << c.d->localeDir; + } + +-int KCatalogPrivate::localeSet = 0; + QByteArray KCatalogPrivate::currentLanguage; + + KCatalog::KCatalog(const QString & name, const QString & language ) + : d( new KCatalogPrivate ) + { +- // Set locales only once. +- if (! KCatalogPrivate::localeSet) { +- setlocale(LC_ALL, ""); +- KCatalogPrivate::localeSet = 1; +- } ++ // Set locales if the static initializer didn't work ++ if (!s_localeSet) { ++ kInitializeLocale(); ++ } + + // Find locale directory for this catalog. + QString localeDir = catalogLocaleDir( name, language ); |