Porting away from KLocale
Kevin Ottens
ervin at kde.org
Thu Oct 24 05:33:40 UTC 2013
On Wednesday 23 October 2013 20:40:19 John Layt wrote:
> On 23 October 2013 12:56, Aleix Pol <aleixpol at kde.org> wrote:
> > On Tue, Oct 22, 2013 at 2:03 PM, David Faure <faure at kde.org> wrote:
> >> On Thursday 17 October 2013 23:47:40 Aleix Pol wrote:
> >> > Well maybe I could help with this, but I'd need to know what do you
> >> > think
> >> > it would be the most appropriate solution.
> >>
> >> I'd say, split it out into a separate function for KF5, and later on, if
> >> you
> >> feel like it, contribute it to Qt for 5.3.
> >
> > I created a task for it on the kdelibs cleanups [1] so anybody can pick it
> > up.
> >
> > Aleix
> >
> > [1] http://community.kde.org/Frameworks/Epics/kdelibs_cleanups
>
> OK, here's a high-level suggested plan:
> * The obviously place to move it is k18n, as either part of
> KLocalizedString or in a new KByteFormatter class?
Hm, wouldn't that fit in KCoreAddons?
> * Move KLocale::BinarySizeUnits, KLocale::BinaryUnitDialect, and
> KLocale::formatByteSize()
> * Do we make it a pure static method? Or require an instance to be created?
> * If static-only then don't need setBinaryUnitDialect(), and
> binaryUnitDialect() will become a static defaultBinaryUnitDialect()
> * No locale file overrides the default BinaryUnitDialect, so we only
> have to worry about reading any user override from kglobals
Or have that done by the caller (thinking about KCoreAddons there, it couldn't
use KConfig for the default).
> * Default to using QLocale() for number formatting, but need to be
> able to set a different locale to use. If static-only then just add
> an extra parameter to override the locale, otherwise will need a
> setLocale()
> * Don't forget the tests :-)
>
> The only other thing we may also want to keep from KLocale is
> formatDuration() / prettyFormatDuration(). It's on my todo list for
> Qt 5.3 and not used many places, but we may want to keep our version
> for now.
Regards
--
Kévin Ottens, http://ervin.ipsquad.net
Sponsored by KDAB to work on KDE Frameworks
KDAB - proud supporter of KDE, http://www.kdab.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20131024/bef54b10/attachment.sig>
More information about the Kde-frameworks-devel
mailing list