[partition] Apply custom partition layout for Erase and Replace choices

This patches add new methods to both PartitionLayout and
PartitionCoreModule classes which apply the partition layout to the
available drive space.

In addition, the partition creation code from PartitioinActions is
removed to call the newly created methods instead, thus applying the
custom partition layout when the "Erase whole disk" and "Replace
partition" choices are selected.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
Arnaud Ferraris 2019-01-07 17:26:37 +01:00
parent f863912a2f
commit 0d284759f5
5 changed files with 138 additions and 63 deletions

View file

@ -63,6 +63,12 @@ public:
void addEntry( QString mountPoint, QString size, QString min = "" );
void addEntry( QString label, QString mountPoint, QString fs, QString size, QString min = "" );
/**
* @brief Apply the current partition layout to the selected drive space.
* @return A list of Partition objects.
*/
QList< Partition* > execute( Device *dev, qint64 firstSector, qint64 lastSector, QString luksPassphrase );
private:
QList< PartitionEntry > partLayout;
};