[partition] Remove some slowdown methods when debugging is off

- Running lsblk and mount for debugging purposes can be
   skipped when the debugging is going to be suppressed anyway.
   This will speed things up just a little for regular users.
This commit is contained in:
Adriaan de Groot 2018-10-05 08:45:10 -04:00
parent 74ab06e20a
commit bb586de056

View file

@ -85,23 +85,26 @@ CreatePartitionTableJob::exec()
cDebug() << "Creating new partition table of type" << table->typeName()
<< ", uncommitted yet:";
for ( auto it = PartitionIterator::begin( table );
it != PartitionIterator::end( table ); ++it )
cDebug() << *it;
if ( Logger::logLevelEnabled( Logger::LOGDEBUG ) )
{
for ( auto it = PartitionIterator::begin( table );
it != PartitionIterator::end( table ); ++it )
cDebug() << *it;
QProcess lsblk;
lsblk.setProgram( "lsblk" );
lsblk.setProcessChannelMode( QProcess::MergedChannels );
lsblk.start();
lsblk.waitForFinished();
cDebug() << "lsblk:\n" << lsblk.readAllStandardOutput();
QProcess lsblk;
lsblk.setProgram( "lsblk" );
lsblk.setProcessChannelMode( QProcess::MergedChannels );
lsblk.start();
lsblk.waitForFinished();
cDebug() << "lsblk:\n" << lsblk.readAllStandardOutput();
QProcess mount;
mount.setProgram( "mount" );
mount.setProcessChannelMode( QProcess::MergedChannels );
mount.start();
mount.waitForFinished();
cDebug() << "mount:\n" << mount.readAllStandardOutput();
QProcess mount;
mount.setProgram( "mount" );
mount.setProcessChannelMode( QProcess::MergedChannels );
mount.start();
mount.waitForFinished();
cDebug() << "mount:\n" << mount.readAllStandardOutput();
}
CreatePartitionTableOperation op(*m_device, table);
op.setStatus(Operation::StatusRunning);