assert--
This commit is contained in:
parent
e792f4c9c5
commit
8d01b9a6fd
@ -51,19 +51,32 @@ Calamares::JobResult
|
|||||||
CreatePartitionJob::exec()
|
CreatePartitionJob::exec()
|
||||||
{
|
{
|
||||||
Report report( 0 );
|
Report report( 0 );
|
||||||
|
QString message = tr( "The installer failed to create partition on %1." ).arg( m_device->name() );
|
||||||
|
|
||||||
CoreBackend* backend = CoreBackendManager::self()->backend();
|
CoreBackend* backend = CoreBackendManager::self()->backend();
|
||||||
QScopedPointer<CoreBackendDevice> backendDevice( backend->openDevice( m_device->deviceNode() ) );
|
QScopedPointer<CoreBackendDevice> backendDevice( backend->openDevice( m_device->deviceNode() ) );
|
||||||
Q_ASSERT( backendDevice.data() );
|
if ( !backendDevice.data() )
|
||||||
|
{
|
||||||
|
return Calamares::JobResult::error(
|
||||||
|
message,
|
||||||
|
tr( "Could not open device %1." ).arg( m_device->deviceNode() )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
QScopedPointer<CoreBackendPartitionTable> backendPartitionTable( backendDevice->openPartitionTable() );
|
QScopedPointer<CoreBackendPartitionTable> backendPartitionTable( backendDevice->openPartitionTable() );
|
||||||
Q_ASSERT( backendPartitionTable );
|
if ( !backendPartitionTable.data() )
|
||||||
|
{
|
||||||
|
return Calamares::JobResult::error(
|
||||||
|
message,
|
||||||
|
tr( "Could not open partition table." )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
QString partitionPath = backendPartitionTable->createPartition( report, *m_partition );
|
QString partitionPath = backendPartitionTable->createPartition( report, *m_partition );
|
||||||
if ( partitionPath.isEmpty() )
|
if ( partitionPath.isEmpty() )
|
||||||
{
|
{
|
||||||
return Calamares::JobResult::error(
|
return Calamares::JobResult::error(
|
||||||
tr( "The installer failed to create partition on %1." ).arg( m_device->name() ),
|
message,
|
||||||
report.toText()
|
report.toText()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user