LVM support #6
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue