Bug 453853 - file size display: please follow BinaryUnitDialect everywhere
Summary: file size display: please follow BinaryUnitDialect everywhere
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: 21.12.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
: 472112 (view as bug list)
Depends on: 57240
  Show dependency treegraph
Reported: 2022-05-15 20:27 UTC by Erik Quaeghebeur
Modified: 2023-07-21 21:21 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: Frameworks 6.0


Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2022-05-15 20:27:57 UTC
Dolphin does not seem to follow the BinaryUnitDialect config option everywhere. Likely it is just a matter of replacing some function with some higher-level ones, as in a few places, Dolphin does do the right thing.

1. Set BinaryUnitDialect=2 in [Locale] section of $KDEHOME/.config/kdeglobals (setting to metric/SI instead of IEC)
2. Start Dolphin
3. Open some folder with files, select, hover, etc.

Mostly IEC formatting is used instead of metric (metric is used in the status bar when selecting/hovering over a file and also for showing the available disc space)

Metric formatting is used everywhere

KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

The BinaryUnitDialect config option is described in Bug 57240. This option is for now still without a GUI, but Bug 364321 makes it clear this is about to change. So apps like Dolphin should be made ready to follow BinaryUnitDialect.
Comment 1 vmelkon 2022-05-17 03:33:59 UTC
I have tested this on Kubuntu 22.04
I can confirm that I have the same result.

KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

I have tried BinaryUnitDialect=2 and BinaryUnitDialect=1.
If I have no file selected, on the Status bar it shows
68 folder, 6 files (6.4 MiB). It is showing MiB instead of MB.
Comment 2 Karl Ove Hufthammer 2023-02-26 11:23:12 UTC
This also applies to displaying file sizes in the settings dialog, e.g., for the ‘Skip previews for local files above:’ setting (‘General’ category). Here (file settings/general/previewssettingspage.cpp) the value is hardcoded using the (translatable) string ‘MiB’.
Comment 3 vmelkon 2023-03-02 17:03:11 UTC
I verified it on Kubuntu 22.04.
In the configure - Dolphin dialog box,
On the left side, select General.
On the right side, select the Preview tab.
At the bottom, Skip previews for local files above, the units are always in MiB

This also effects System Monitor. It always shows RAM usage and network activity as KiB and MiB and GiB. There doesn’t seem to be a way to configure it.
Comment 4 Jack Hill 2023-07-09 22:23:02 UTC
*** Bug 472112 has been marked as a duplicate of this bug. ***
Comment 5 Bug Janitor Service 2023-07-10 10:52:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/572
Comment 6 Bug Janitor Service 2023-07-11 15:43:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/352
Comment 7 Jack Hill 2023-07-15 20:20:43 UTC
Git commit 58cb8fcc5f8290cf2ecac5c3f5ebd9ac69aa8f10 by Jack Hill.
Committed on 12/07/2023 at 17:01.
Pushed by cullmann into branch 'master'.

Use BinaryUnitDialect from config when using DefaultBinaryDialect in formatByteSize

Still fall back to IECBinaryDialect if the value isn't set, or isn't set
Related: bug 472111

M  +8    -2    src/lib/util/kformatprivate.cpp