Sort partitions by first sector.

This commit is contained in:
Andrius Štikonas 2017-12-21 23:16:12 +00:00
parent f9cd824075
commit 3e7e9d8955
2 changed files with 2 additions and 0 deletions

View File

@ -213,6 +213,7 @@ public:
void append(Partition* p) override {
m_Children.append(p);
std::sort(m_Children.begin(), m_Children.end(), [] (const Partition *a, const Partition *b) -> bool {return a->firstSector() < b->firstSector();});
}
void setDevicePath(const QString& s) {
m_DevicePath = s;

View File

@ -173,6 +173,7 @@ int PartitionTable::numPrimaries() const
void PartitionTable::append(Partition* partition)
{
children().append(partition);
std::sort(children().begin(), children().end(), [] (const Partition *a, const Partition *b) -> bool {return a->firstSector() < b->firstSector();});
}
/** @param f the flag to get the name for