Use KFormat for formatting byte sizes
ClosedPublic

Authored by pino on Jun 14 2018, 8:12 PM.

Details

Summary

Use what is already available in KCoreAddons, instead of two custom
versions of it.

Test Plan

Builds fine, and the standard formatting is used.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
pino created this revision.Jun 14 2018, 8:12 PM
Restricted Application added a project: Krita. · View Herald TranscriptJun 14 2018, 8:12 PM
pino requested review of this revision.Jun 14 2018, 8:12 PM

I think you probably should specify KFormat::JEDECBinaryDialect.

dkazakov accepted this revision.Jun 15 2018, 10:42 AM
dkazakov added a subscriber: dkazakov.

Hi, @pino!

The patch looks and works fine! Please push it into master! We cannot backport it into 4.1 though, because we are in a string freeze. But in the future we should really use KFormat for such things :)

This revision is now accepted and ready to land.Jun 15 2018, 10:42 AM
pino added a comment.Jun 15 2018, 7:41 PM

We cannot backport it into 4.1 though, because we are in a string freeze. But in the future we should really use KFormat for such things :)

Can I backport it, if I exclude the changes to libs/ui/widgets/kis_custom_image_widget.cc? Removing strings (especially if not needed anymore) is usually OK during string freezes.

This revision was automatically updated to reflect the committed changes.
dkazakov added a subscriber: rempt.Jun 15 2018, 7:44 PM

Hi, @pino!

It would be nice to consult @rempt on IRC about that. Does KFormat belong to KF5 Tier1? If so, I guess it should be okay to backport the changes excluding the custom image widget. Otherwise, I would first checked if it compiles on all the platforms.

pino added a comment.Jun 15 2018, 7:46 PM

It would be nice to consult @rempt on IRC about that. Does KFormat belong to KF5 Tier1?

It is part of the KCoreAddons framework, already used in various places (even in kritaui already, that is why I did not even need to add new libraries to link).

Then I think it should be fine to backport to krita/4.1 branch.

rempt added a comment.Jun 15 2018, 9:06 PM

Sorry... i was away this evening watching a movie that's 105 years old. But yes, I'm fine with this change. When we created this code we just didn't know about the pre-existing functionality.