Review Request 118564: Fix locale-aware reading in KDesktopFile
John Layt
jlayt at kde.org
Fri Jun 6 11:21:57 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118564/#review59415
-----------------------------------------------------------
src/core/kconfig.cpp
<https://git.reviewboard.kde.org/r/118564/#comment41384>
The bcp47Name() is a complicated beast that could add lots of other bits on like script to use, etc. I would stick with name() as it is documented in Qt to always return language_COUNTRY, so "QLocale().name().split('_').at(0)". I'll remember to add the needed languageCode() api for QT 5.4.
- John Layt
On June 5, 2014, 1:16 p.m., Martin Gräßlin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118564/
> -----------------------------------------------------------
>
> (Updated June 5, 2014, 1:16 p.m.)
>
>
> Review request for KDE Frameworks and John Layt.
>
>
> Repository: kconfig
>
>
> Description
> -------
>
> 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.
>
>
> Diffs
> -----
>
> autotests/kdesktopfiletest.h d57351fd6edcefd6a0efd9126e454546cfc63b55
> autotests/kdesktopfiletest.cpp 494a43c0fb5808a261b9beb56cdc4afd8580ab21
> src/core/kconfig.cpp ea9746c001e235529a1cdd5865b9e1b5c129b56a
>
> Diff: https://git.reviewboard.kde.org/r/118564/diff/
>
>
> Testing
> -------
>
> added unit test failed before. I'm not 100 % sure whether using bcp47Name is correct.
>
>
> Thanks,
>
> Martin Gräßlin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140606/cc3f1cea/attachment.html>
More information about the Kde-frameworks-devel
mailing list