Commit ae246349 authored by Pino Toscano's avatar Pino Toscano

Use KFormat also in performance preferences

Format the amount of available RAM using KFormat, but keeping the same
unit, and scale (since the controls there refer to specific ones).

Test Plan:
The amount of RAM is shown in KiB as before, although
formatted according to KFormat & locale.

Reviewers: #krita, rempt

Reviewed By: #krita, rempt

Tags: #krita

Differential Revision:
parent bef246fb
......@@ -57,6 +57,7 @@
#include <KoVBox.h>
#include <klocalizedstring.h>
#include <kformat.h>
#include <kundo2stack.h>
#include <KoResourcePaths.h>
#include "kis_action_registry.h"
......@@ -710,8 +711,8 @@ PerformanceTab::PerformanceTab(QWidget *parent, const char *name)
: WdgPerformanceSettings(parent, name)
KisImageConfig cfg;
const int totalRAM = cfg.totalRAM();
lblTotalMemory->setText(i18n("%1 MiB", totalRAM));
const double totalRAM = cfg.totalRAM();
lblTotalMemory->setText(KFormat().formatByteSize(totalRAM * 1024 * 1024, 0, KFormat::IECBinaryDialect, KFormat::UnitMegaByte));
sliderMemoryLimit->setSuffix(i18n(" %"));
sliderMemoryLimit->setRange(1, 100, 2);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment