[partition] Avoid heap-wrangling
- The CreatePartitionDialog doesn't need to be on the heap, it's modal here. Avoid QPointer weirdness as well.
This commit is contained in:
parent
943f3fb1f9
commit
b4cefff975
@ -362,18 +362,18 @@ PartitionPage::onCreateClicked()
|
|||||||
if ( !checkCanCreate( model->device() ) )
|
if ( !checkCanCreate( model->device() ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QPointer< CreatePartitionDialog > dlg = new CreatePartitionDialog( model->device(),
|
CreatePartitionDialog dlg(
|
||||||
partition->parent(),
|
model->device(),
|
||||||
nullptr,
|
partition->parent(),
|
||||||
getCurrentUsedMountpoints(),
|
nullptr,
|
||||||
this );
|
getCurrentUsedMountpoints(),
|
||||||
dlg->initFromFreeSpace( partition );
|
this );
|
||||||
if ( dlg->exec() == QDialog::Accepted )
|
dlg.initFromFreeSpace( partition );
|
||||||
|
if ( dlg.exec() == QDialog::Accepted )
|
||||||
{
|
{
|
||||||
Partition* newPart = dlg->createPartition();
|
Partition* newPart = dlg.createPartition();
|
||||||
m_core->createPartition( model->device(), newPart, dlg->newFlags() );
|
m_core->createPartition( model->device(), newPart, dlg.newFlags() );
|
||||||
}
|
}
|
||||||
delete dlg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user