Review Request 114187: KFormat - Add new KFormat class

Kevin Ottens ervin at kde.org
Tue Dec 10 20:51:28 UTC 2013



> On Dec. 4, 2013, 7:32 p.m., Kevin Ottens wrote:
> > Any chance for an update addressing the comments raised?
> 
> Kevin Ottens wrote:
>     John, please update ASAP, it's one of the patch we're waiting for to split.
> 
> Alex Merry wrote:
>     If John is unavailable, I can take over this.

Tried to contact him via several channels with no luck. Please take over this, we need to crack this one NOW.


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/114187/#review45135
-----------------------------------------------------------


On Nov. 28, 2013, 8 p.m., John Layt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/114187/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2013, 8 p.m.)
> 
> 
> Review request for KDE Frameworks, Albert Astals Cid, David Faure, and Kevin Ottens.
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> KFormat - Add new KFormat class
> 
> KLocale offers a number of extra formatting options not yet available
> in Qt.  The KFormat class adds these options to KCoreAddons:
> 
> * formatByteSize()
> * formatDuration()
> * formatDecimalDuration()
> * formatSpelloutDuration()
> * formatRelativeDate()
> * formatRelativeDateTime()
> 
> The KFormat class can be initialised with any QLocale to use in the
> date and number formatting, or the default locale can be easily
> accessed via KFormat():
> 
>   QString result = KFormat().formatDuration(1000);
> 
> ----------------------------------------
> 
> There's a few things that need looking at here.  The main one is the translation stuff because I had to convert from using ki18n to tr and it may have lost something in the process.  In particular it looks like we'll actually need an en_US translation done to get the plurals right?  If we can't make tr() work for these we'll have to move the class into  k18n.  The second is to look at the formatting options provided and decide if they are actually useful to have.  The third is to confirm that the design is OK, I did think about making these simple static methods with an extra parm for QLocale, but I think this approach offers more future flexibility, and writing KFormat().formatDuration() is just as convenient as KFormat::formatDuration().
> 
> 
> Diffs
> -----
> 
>   tier1/kcoreaddons/autotests/CMakeLists.txt c8043576181e7d06663195d017be930d0bdcbde9 
>   tier1/kcoreaddons/autotests/kformattest.h PRE-CREATION 
>   tier1/kcoreaddons/autotests/kformattest.cpp PRE-CREATION 
>   tier1/kcoreaddons/src/lib/CMakeLists.txt 638525f7b719bcd0bc1dfdf94debd51296521334 
>   tier1/kcoreaddons/src/lib/util/kformat.h PRE-CREATION 
>   tier1/kcoreaddons/src/lib/util/kformat.cpp PRE-CREATION 
>   tier1/kcoreaddons/src/lib/util/kformatprivate.cpp PRE-CREATION 
>   tier1/kcoreaddons/src/lib/util/kformatprivate_p.h PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/114187/diff/
> 
> 
> Testing
> -------
> 
> Autotests copied from KLocale tests and improved.
> 
> 
> Thanks,
> 
> John Layt
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20131210/51ee9229/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list