Partition: reduce code duplications
This commit is contained in:
parent
7d49255a78
commit
18a1f459db
@ -98,6 +98,13 @@ isIso9660( const Device* device )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static inline QDebug&
|
||||||
|
operator <<( QDebug& s, QList< Device* >::iterator& it )
|
||||||
|
{
|
||||||
|
s << ( ( *it ) ? ( *it )->deviceNode() : QString( "<null device>" ) );
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
QList< Device* > getDevices( DeviceType which )
|
QList< Device* > getDevices( DeviceType which )
|
||||||
{
|
{
|
||||||
bool writableOnly = (which == DeviceType::WritableOnly);
|
bool writableOnly = (which == DeviceType::WritableOnly);
|
||||||
@ -115,7 +122,7 @@ QList< Device* > getDevices( DeviceType which )
|
|||||||
( *it )->deviceNode().startsWith( "/dev/zram" )
|
( *it )->deviceNode().startsWith( "/dev/zram" )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cDebug() << " .. Removing" << ( ( *it ) ? ( *it )->deviceNode() : QString( "<null device>" ) );
|
cDebug() << " .. Removing" << it;
|
||||||
it = devices.erase( it );
|
it = devices.erase( it );
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -125,7 +132,7 @@ QList< Device* > getDevices( DeviceType which )
|
|||||||
isMounted( *it ) )
|
isMounted( *it ) )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cDebug() << " .. Removing" << ( ( *it ) ? ( *it )->deviceNode() : QString( "<null device>" ) );
|
cDebug() << " .. Removing" << it;
|
||||||
it = devices.erase( it );
|
it = devices.erase( it );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user