D12164: Add overloads to Value/Unit::toString/toSymbolString taking a QLocale

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Thu Apr 12 21:02:42 UTC 2018


kossebau created this revision.
kossebau added a reviewer: ilic.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
kossebau requested review of this revision.

REVISION SUMMARY
  The existing toString/toSymbolString methods use KLocalizedString::subs(),
  which itself uses QString::arg() for creating the number. Which does
  not take any QLocale into account.
  The new overload method with a QLocale argument allow the caller full
  control over which locale is used. Sadly QLocale does not have a
  toString() method taking a fieldWidth parameter, so the overloads cannot
  offer that feature.

TEST PLAN
  Unit tests still pass (need english system locale though, needs separate
  fix)

REPOSITORY
  R292 KUnitConversion

BRANCH
  addToStringWithLocale

REVISION DETAIL
  https://phabricator.kde.org/D12164

AFFECTED FILES
  autotests/valuetest.cpp
  src/unit.cpp
  src/unit.h
  src/value.cpp
  src/value.h

To: kossebau, ilic
Cc: #frameworks, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180412/2683a5b3/attachment.html>


More information about the Kde-frameworks-devel mailing list