Review Request 118564: Fix locale-aware reading in KDesktopFile

Matthew Dawson matthew at mjdsystems.ca
Wed Jun 11 15:05:55 UTC 2014



> On June 7, 2014, 12:33 a.m., Matthew Dawson wrote:
> > autotests/kconfigtest.cpp, line 930
> > <https://git.reviewboard.kde.org/r/118564/diff/3/?file=279334#file279334line930>
> >
> >     Similarly, can you just change the config object's locale to something (en seems fine here) instead of changing the global?

To avoid creating the duplicated code, why not just change the KConfig object's locale?  I tested that locally, and it seems to resolve the issue.  Otherwise, can you move the DefaultLocale class to a header?  Since it is so simple, I think the functions can all just be left as inline functions so no cpp file required.


- Matthew


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118564/#review59483
-----------------------------------------------------------


On June 10, 2014, 2:42 a.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118564/
> -----------------------------------------------------------
> 
> (Updated June 10, 2014, 2:42 a.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/kconfigtest.cpp 2b6de0d7d63df6aee69210aa09418628f0b8110a 
>   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/20140611/9ad05571/attachment.html>


More information about the Kde-frameworks-devel mailing list