[partition] move parseSizeString() function to PartUtils

In order to be able to parse partition size strings using the same
functions across the partition module, the parseSizeString() function is
exported to the PartUtils namespace.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
Arnaud Ferraris 2019-02-28 13:18:02 +01:00
parent d289b1bed4
commit 90eb6afd52
4 changed files with 78 additions and 67 deletions

View file

@ -20,6 +20,8 @@
#ifndef PARTITIONLAYOUT_H
#define PARTITIONLAYOUT_H
#include "core/PartUtils.h"
#include "Typedefs.h"
// KPMcore
@ -36,24 +38,15 @@ class PartitionLayout
{
public:
enum SizeUnit
{
Percent = 0,
Byte,
KiB,
MiB,
GiB
};
struct PartitionEntry
{
QString partLabel;
QString partMountPoint;
FileSystem::Type partFileSystem = FileSystem::Unknown;
double partSize = 0.0L;
SizeUnit partSizeUnit = Percent;
PartUtils::SizeUnit partSizeUnit = PartUtils::SizeUnit::Percent;
double partMinSize = 0.0L;
SizeUnit partMinSizeUnit = Percent;
PartUtils::SizeUnit partMinSizeUnit = PartUtils::SizeUnit::Percent;
/// @brief All-zeroes PartitionEntry
PartitionEntry() {};