File kdelibs-4.2.95-runtime-qt-locale-initialized.patch of Package kdelibs4
Index: kdecore/CMakeLists.txt
===================================================================
--- kdecore/CMakeLists.txt
+++ kdecore/CMakeLists.txt 2009-06-25 01:17:44.000000000 +0200
@@ -285,7 +285,7 @@
kde4_add_library(kdecore SHARED ${kdecore_LIB_SRCS})
-target_link_libraries(kdecore ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTXML_LIBRARY} ${ZLIB_LIBRARY} ${kdecore_OPTIONAL_LIBS})
+target_link_libraries(kdecore ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTXML_LIBRARY} ${ZLIB_LIBRARY} ${kdecore_OPTIONAL_LIBS} dl)
if(WIN32)
set(kdecore_LINK_INTERFACE_LIBRARIES ${QT_QTDBUS_LIBRARY} ${QT_QTCORE_LIBRARY} ${KDEWIN_LIBRARIES})
Index: kdecore/localization/kcatalog.cpp
===================================================================
--- kdecore/localization/kcatalog.cpp
+++ kdecore/localization/kcatalog.cpp 2009-06-25 01:18:43.000000000 +0200
@@ -40,8 +40,9 @@
int kInitializeLocale()
{
setlocale(LC_ALL, "");
- extern Q_CORE_EXPORT bool qt_locale_initialized; // in Qt since 4.5.0
- qt_locale_initialized = true; // as recommended by Thiago
+ if (strncmp(qVersion(), "4.5", 3) == 0) { // it's Qt 4.5
+ *(bool*)dlsym(RTLD_DEFAULT, "qt_locale_initialized") = true;
+ }
s_localeSet = true;
return 1;
}
--- kdecore/localization/kcatalog.cpp~ 2009-06-25 01:23:33.000000000 +0200
+++ kdecore/localization/kcatalog.cpp 2009-06-25 01:32:11.000000000 +0200
@@ -30,7 +30,7 @@
#include <stdlib.h>
#include <locale.h>
#include "gettext.h"
-
+#include <dlfcn.h>
static bool s_localeSet = false;