rpms/kdelibs/devel kdelibs-4.2.1-encoding-qt45.patch, NONE, 1.1 kdelibs.spec, 1.453, 1.454
Than Ngo
than at fedoraproject.org
Thu Mar 12 12:39:13 UTC 2009
Author: than
Update of /cvs/extras/rpms/kdelibs/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9216
Modified Files:
kdelibs.spec
Added Files:
kdelibs-4.2.1-encoding-qt45.patch
Log Message:
apply patcch to fix encoding for Qt-4.5.0
kdelibs-4.2.1-encoding-qt45.patch:
--- NEW FILE kdelibs-4.2.1-encoding-qt45.patch ---
--- kdelibs-4.2.1/kdecore/localization/kcatalog.cpp (Revision 938369)
+++ kdelibs-4.2.1/kdecore/localization/kcatalog.cpp (Revision 938370)
@@ -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 );
Index: kdelibs.spec
===================================================================
RCS file: /cvs/extras/rpms/kdelibs/devel/kdelibs.spec,v
retrieving revision 1.453
retrieving revision 1.454
diff -u -r1.453 -r1.454
--- kdelibs.spec 9 Mar 2009 22:35:47 -0000 1.453
+++ kdelibs.spec 12 Mar 2009 12:38:41 -0000 1.454
@@ -1,6 +1,6 @@
Summary: K Desktop Environment 4 - Libraries
Version: 4.2.1
-Release: 5%{?dist}
+Release: 6%{?dist}
%if 0%{?fedora} > 8
Name: kdelibs
@@ -86,6 +86,7 @@
# upstream
# 4.2 branch
Patch100: kdelibs-4.2.1-css.patch
+Patch101: kdelibs-4.2.1-encoding-qt45.patch
# 4.3 branch
Patch200: kdelibs-4.1.96-AllowExternalPaths.patch
@@ -223,6 +224,7 @@
# upstream patches
# 4.2
%patch100 -p1 -b .css-style
+%patch101 -p1 -b .encoding-qt45
# 4.3
%patch200 -p1 -b .AllowExternalPaths
@@ -399,6 +401,9 @@
%changelog
+* Thu Mar 12 2009 Than Ngo <than at redhat.com> - 4.2.1-6
+- apply patch to fix encoding for Qt-4.5.0
+
* Mon Mar 09 2009 Than Ngo <than at redhat.com> - 4.2.1-5
- apply patch to fix issue in CSS style that causes konqueror shows a blank page
More information about the fedora-extras-commits
mailing list