Be more verbose while scanning devices

This commit is contained in:
Adriaan de Groot 2017-07-04 05:32:05 -04:00 committed by Philip
parent 0a278ca546
commit 5be4a00f62

View File

@ -153,19 +153,27 @@ PartitionCoreModule::doInit()
{ {
FileSystemFactory::init(); FileSystemFactory::init();
using DeviceList = QList< Device* >;
CoreBackend* backend = CoreBackendManager::self()->backend(); 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 // 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 ) || if ( ! (*it) || hasRootPartition( *it ) ||
(*it)->deviceNode().startsWith( "/dev/zram") || (*it)->deviceNode().startsWith( "/dev/zram") ||
isIso9660( *it ) ) isIso9660( *it ) )
{
cDebug() << " .. Winnowing" << ( (*it) ? (*it)->deviceNode() : QString( "<null device>" ) );
it = devices.erase( it ); it = devices.erase( it );
}
else else
++it; ++it;
cDebug() << "LIST OF DETECTED DEVICES:\nnode\tcapacity\tname\tprettyName"; cDebug() << "LIST OF DETECTED DEVICES:";
cDebug() << "node\tcapacity\tname\tprettyName";
for ( auto device : devices ) for ( auto device : devices )
{ {
auto deviceInfo = new DeviceInfo( device ); auto deviceInfo = new DeviceInfo( device );