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 --- src/core/kconfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/kconfig.cpp') diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index ea9746c0..cfa6c207 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -95,7 +95,7 @@ KConfigPrivate::KConfigPrivate(KConfig::OpenFlags flags, // mappingsRegistered = true; // } - setLocale(QLocale::system().name()); + setLocale(QLocale().name().split(QStringLiteral("_")).at(0)); } bool KConfigPrivate::lockLocal() -- cgit v1.2.1