Revision ea1fbbe...

Go back to digest for 15th December 2013

Features in KDE Base

Alex Merry committed changes in [kdelibs/frameworks] /kcoreaddons:

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);

File Changes

Added 6 files
  • /kcoreaddons
  •   tier1/autotests/kformattest.cpp
  •   tier1/autotests/kformattest.h
  •   tier1/src/lib/util/kformat.cpp
  •   tier1/src/lib/util/kformat.h
  •   tier1/src/lib/util/kformatprivate.cpp
  •   tier1/src/lib/util/kformatprivate_p.h
Modified 2 files
  • /kcoreaddons
  •   tier1/autotests/CMakeLists.txt
  •   tier1/src/lib/CMakeLists.txt
8 files changed in total