diff --git a/src/modules/partition/core/DeviceList.cpp b/src/modules/partition/core/DeviceList.cpp index 944940d9a..041801b9e 100644 --- a/src/modules/partition/core/DeviceList.cpp +++ b/src/modules/partition/core/DeviceList.cpp @@ -92,6 +92,19 @@ isIso9660( const Device* device ) return false; } +static inline bool +isZRam( const Device* device ) +{ + const QString path = device->deviceNode(); + return path.startsWith( "/dev/zram" ); +} + +static inline bool +isFloppyDrive( const Device* device ) +{ + const QString path = device->deviceNode(); + return path.startsWith( "/dev/fd" ) || path.startsWith( "/dev/floppy" ); +} static inline QDebug& operator<<( QDebug& s, QList< Device* >::iterator& it ) @@ -112,7 +125,7 @@ erase( DeviceList& l, DeviceList::iterator& it ) } QList< Device* > -getDevices( DeviceType which, qint64 minimumSize ) +getDevices( DeviceType which ) { bool writableOnly = ( which == DeviceType::WritableOnly ); @@ -138,11 +151,16 @@ getDevices( DeviceType which, qint64 minimumSize ) cDebug() << Logger::SubEntry << "Skipping nullptr device"; it = erase( devices, it ); } - else if ( ( *it )->deviceNode().startsWith( "/dev/zram" ) ) + else if ( isZRam( *it ) ) { cDebug() << Logger::SubEntry << "Removing zram" << it; it = erase( devices, it ); } + else if ( isFloppyDrive( ( *it ) ) ) + { + cDebug() << Logger::SubEntry << "Removing floppy disk" << it; + it = erase( devices, it ); + } else if ( writableOnly && hasRootPartition( *it ) ) { cDebug() << Logger::SubEntry << "Removing device with root filesystem (/) on it" << it; @@ -153,11 +171,6 @@ getDevices( DeviceType which, qint64 minimumSize ) cDebug() << Logger::SubEntry << "Removing device with iso9660 filesystem (probably a CD) on it" << it; it = erase( devices, it ); } - else if ( ( minimumSize >= 0 ) && !( ( *it )->capacity() > minimumSize ) ) - { - cDebug() << Logger::SubEntry << "Removing too-small" << it; - it = erase( devices, it ); - } else { ++it; diff --git a/src/modules/partition/core/DeviceList.h b/src/modules/partition/core/DeviceList.h index 6823d6951..51c71feeb 100644 --- a/src/modules/partition/core/DeviceList.h +++ b/src/modules/partition/core/DeviceList.h @@ -45,7 +45,7 @@ enum class DeviceType * greater than @p minimumSize will be returned. * @return a list of Devices meeting this criterium. */ -QList< Device* > getDevices( DeviceType which = DeviceType::All, qint64 minimumSize = -1 ); +QList< Device* > getDevices( DeviceType which = DeviceType::All ); } // namespace PartUtils diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index a583a4b96..b0142a82a 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -122,6 +122,7 @@ PartitionViewStep::~PartitionViewStep() { m_manualPartitionPage->deleteLater(); } + delete m_core; }