make sure we still have a selected partition when trying to use it (now that
the signal handler for operationsChanged in MainWindow calls updatePartitions, this is required) svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1098148
This commit is contained in:
parent
3392940beb
commit
845f44ccef
|
@ -383,20 +383,22 @@ void PartitionManagerWidget::onPropertiesPartition()
|
||||||
{
|
{
|
||||||
if (selectedPartition())
|
if (selectedPartition())
|
||||||
{
|
{
|
||||||
|
Partition& p = *selectedPartition();
|
||||||
|
|
||||||
Q_ASSERT(selectedDevice());
|
Q_ASSERT(selectedDevice());
|
||||||
|
|
||||||
QPointer<PartPropsDialog> dlg = new PartPropsDialog(this, *selectedDevice(), *selectedPartition());
|
QPointer<PartPropsDialog> dlg = new PartPropsDialog(this, *selectedDevice(), p);
|
||||||
|
|
||||||
if (dlg->exec() == KDialog::Accepted)
|
if (dlg->exec() == KDialog::Accepted)
|
||||||
{
|
{
|
||||||
if (dlg->newFileSystemType() != selectedPartition()->fileSystem().type() || dlg->forceRecreate())
|
if (dlg->newFileSystemType() != p.fileSystem().type() || dlg->forceRecreate())
|
||||||
operationStack().push(new CreateFileSystemOperation(*selectedDevice(), *selectedPartition(), dlg->newFileSystemType()));
|
operationStack().push(new CreateFileSystemOperation(*selectedDevice(), p, dlg->newFileSystemType()));
|
||||||
|
|
||||||
if (dlg->newLabel() != selectedPartition()->fileSystem().label())
|
if (dlg->newLabel() != p.fileSystem().label())
|
||||||
operationStack().push(new SetFileSystemLabelOperation(*selectedPartition(), dlg->newLabel()));
|
operationStack().push(new SetFileSystemLabelOperation(p, dlg->newLabel()));
|
||||||
|
|
||||||
if (dlg->newFlags() != selectedPartition()->activeFlags())
|
if (dlg->newFlags() != p.activeFlags())
|
||||||
operationStack().push(new SetPartFlagsOperation(*selectedDevice(), *selectedPartition(), dlg->newFlags()));
|
operationStack().push(new SetPartFlagsOperation(*selectedDevice(), p, dlg->newFlags()));
|
||||||
|
|
||||||
updatePartitions();
|
updatePartitions();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue