mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-26 17:05:36 -04:00
Safer dialog handling
This commit is contained in:
parent
5eafb9538e
commit
90d26bfd31
1 changed files with 5 additions and 4 deletions
|
@ -29,6 +29,7 @@
|
|||
// Qt
|
||||
#include <QDebug>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QPointer>
|
||||
|
||||
PartitionPage::PartitionPage( QWidget* parent )
|
||||
: Calamares::AbstractPage( parent )
|
||||
|
@ -93,10 +94,10 @@ void PartitionPage::onCreateClicked()
|
|||
Partition* partition = model->partitionForIndex( index );
|
||||
Q_ASSERT( partition );
|
||||
|
||||
CreatePartitionDialog dlg( model->device(), partition, this );
|
||||
if ( !dlg.exec() )
|
||||
QPointer<CreatePartitionDialog> dlg = new CreatePartitionDialog( model->device(), partition, this );
|
||||
if ( dlg->exec() == QDialog::Accepted )
|
||||
{
|
||||
return;
|
||||
m_core->createPartition( dlg->createJob() );
|
||||
}
|
||||
m_core->createPartition( dlg.createJob() );
|
||||
delete dlg;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue