LVM support #6

Closed
andrius wants to merge 109 commits from (deleted):lvm-support-rebase into master
3 changed files with 13 additions and 0 deletions
Showing only changes of commit 0ab8227d94 - Show all commits

View File

@ -89,6 +89,17 @@ qint64 PartitionTable::freeSectorsAfter(const Partition& p) const
return 0;
}
qint64 PartitionTable::freeSectors() const
{
qint64 sectors = 0;
foreach(const Partition * p, children())
if (p->roles().has(PartitionRole::Unallocated)) {
sectors += p->length();
}
return sectors;
}
/** @return true if the PartitionTable has an extended Partition */
bool PartitionTable::hasExtended() const
{

View File

@ -126,6 +126,7 @@ public:
qint64 freeSectorsBefore(const Partition& p) const;
qint64 freeSectorsAfter(const Partition& p) const;
qint64 freeSectors() const;
bool hasExtended() const;
Partition* extended() const;

View File

@ -135,6 +135,7 @@ qint32 PartResizerWidget::handleWidth() const
qint64 PartResizerWidget::sectorsPerPixel() const
{
//FIXME: Make sure that this function never return 0
return totalSectors() / (width() - 2 * handleWidth());
}