add preferred capacity to config
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1102330
This commit is contained in:
parent
537108c78f
commit
5ad584990b
|
@ -5,6 +5,7 @@
|
|||
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
|
||||
<kcfgfile arg="true"/>
|
||||
<include>fs/filesystem.h</include>
|
||||
<include>util/capacity.h</include>
|
||||
<group name="KDE Partition Manager">
|
||||
<entry name="treePartitionColumnWidths" type="IntList" hidden="true">
|
||||
<default>140,90,90,90,0,90,90,0,0,0,0,0</default>
|
||||
|
@ -84,5 +85,8 @@
|
|||
<entry key="defaultFileSystem" type="Int">
|
||||
<default>FileSystem::Ext3</default>
|
||||
</entry>
|
||||
<entry key="preferredUnit" type="Int">
|
||||
<default>Capacity::MiB</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include <klocale.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
const QString Capacity::m_InvalidString = "---";
|
||||
|
||||
/** Creates a new Capacity instance.
|
||||
|
@ -188,3 +190,9 @@ QString Capacity::toStringInternal(Unit u) const
|
|||
const double num = static_cast<double>(m_Size) / static_cast<double>(unitSize);
|
||||
return KGlobal::locale()->formatNumber(num, u == Byte ? 0 : -1);
|
||||
}
|
||||
|
||||
Capacity::Unit Capacity::preferredUnit()
|
||||
{
|
||||
return static_cast<Unit>(Config::preferredUnit());
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ class Capacity
|
|||
static const QString& invalidString() { return m_InvalidString; } /**< @return string representing an invalid capacity */
|
||||
static QString unitName(Unit u);
|
||||
static qint64 unitFactor(Unit from, Unit to);
|
||||
static Unit preferredUnit();
|
||||
|
||||
protected:
|
||||
QString toStringInternal(Unit u) const;
|
||||
|
|
Loading…
Reference in New Issue