From 988f09bb051dca0437ecec431ee44ed5b4a560d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 5 Jun 2014 14:05:44 +0200 Subject: Fix locale-aware reading in KDesktopFile The underlying KConfig used QLocale::name() for getting the locale aware part. But this returns "de_DE" while the desktop files store "de". In addition it constructs a QLocale object instead of using the system locale. This has the advantage that the usage of QLocale::setDafault() gets honored by KConfig. REVIEW: 118564 --- autotests/kconfigtest.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'autotests/kconfigtest.cpp') diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp index 2b6de0d7..a8482b70 100644 --- a/autotests/kconfigtest.cpp +++ b/autotests/kconfigtest.cpp @@ -21,6 +21,7 @@ #undef QT_NO_CAST_FROM_BYTEARRAY #include "kconfigtest.h" +#include "helper.h" #include #include @@ -927,6 +928,8 @@ void KConfigTest::testCascadingWithLocale() void KConfigTest::testMerge() { + DefaultLocale defaultLocale; + QLocale::setDefault(QLocale::c()); KConfig config(TEST_SUBDIR "mergetest", KConfig::SimpleConfig); KConfigGroup cg = config.group("some group"); -- cgit v1.2.1