[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:
parent
74ab06e20a
commit
bb586de056
@ -85,23 +85,26 @@ CreatePartitionTableJob::exec()
|
|||||||
cDebug() << "Creating new partition table of type" << table->typeName()
|
cDebug() << "Creating new partition table of type" << table->typeName()
|
||||||
<< ", uncommitted yet:";
|
<< ", uncommitted yet:";
|
||||||
|
|
||||||
for ( auto it = PartitionIterator::begin( table );
|
if ( Logger::logLevelEnabled( Logger::LOGDEBUG ) )
|
||||||
it != PartitionIterator::end( table ); ++it )
|
{
|
||||||
cDebug() << *it;
|
for ( auto it = PartitionIterator::begin( table );
|
||||||
|
it != PartitionIterator::end( table ); ++it )
|
||||||
|
cDebug() << *it;
|
||||||
|
|
||||||
QProcess lsblk;
|
QProcess lsblk;
|
||||||
lsblk.setProgram( "lsblk" );
|
lsblk.setProgram( "lsblk" );
|
||||||
lsblk.setProcessChannelMode( QProcess::MergedChannels );
|
lsblk.setProcessChannelMode( QProcess::MergedChannels );
|
||||||
lsblk.start();
|
lsblk.start();
|
||||||
lsblk.waitForFinished();
|
lsblk.waitForFinished();
|
||||||
cDebug() << "lsblk:\n" << lsblk.readAllStandardOutput();
|
cDebug() << "lsblk:\n" << lsblk.readAllStandardOutput();
|
||||||
|
|
||||||
QProcess mount;
|
QProcess mount;
|
||||||
mount.setProgram( "mount" );
|
mount.setProgram( "mount" );
|
||||||
mount.setProcessChannelMode( QProcess::MergedChannels );
|
mount.setProcessChannelMode( QProcess::MergedChannels );
|
||||||
mount.start();
|
mount.start();
|
||||||
mount.waitForFinished();
|
mount.waitForFinished();
|
||||||
cDebug() << "mount:\n" << mount.readAllStandardOutput();
|
cDebug() << "mount:\n" << mount.readAllStandardOutput();
|
||||||
|
}
|
||||||
|
|
||||||
CreatePartitionTableOperation op(*m_device, table);
|
CreatePartitionTableOperation op(*m_device, table);
|
||||||
op.setStatus(Operation::StatusRunning);
|
op.setStatus(Operation::StatusRunning);
|
||||||
|
Loading…
Reference in New Issue
Block a user