From 5be4a00f6295dae8302e559b151135a5ffd8e93c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 4 Jul 2017 05:32:05 -0400 Subject: [PATCH] Be more verbose while scanning devices --- src/modules/partition/core/PartitionCoreModule.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/partition/core/PartitionCoreModule.cpp b/src/modules/partition/core/PartitionCoreModule.cpp index 608508d60..6afae1f09 100644 --- a/src/modules/partition/core/PartitionCoreModule.cpp +++ b/src/modules/partition/core/PartitionCoreModule.cpp @@ -153,19 +153,27 @@ PartitionCoreModule::doInit() { FileSystemFactory::init(); + using DeviceList = QList< Device* >; + CoreBackend* backend = CoreBackendManager::self()->backend(); - QList< Device* > devices = backend->scanDevices( true ); + DeviceList devices = backend->scanDevices( true ); + + cDebug() << "Winnowing" << devices.count() << "devices."; // Remove the device which contains / from the list - for ( QList< Device* >::iterator it = devices.begin(); it != devices.end(); ) + for ( DeviceList::iterator it = devices.begin(); it != devices.end(); ) if ( ! (*it) || hasRootPartition( *it ) || (*it)->deviceNode().startsWith( "/dev/zram") || isIso9660( *it ) ) + { + cDebug() << " .. Winnowing" << ( (*it) ? (*it)->deviceNode() : QString( "" ) ); it = devices.erase( it ); + } else ++it; - cDebug() << "LIST OF DETECTED DEVICES:\nnode\tcapacity\tname\tprettyName"; + cDebug() << "LIST OF DETECTED DEVICES:"; + cDebug() << "node\tcapacity\tname\tprettyName"; for ( auto device : devices ) { auto deviceInfo = new DeviceInfo( device );