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:
Volker Lanz 2010-03-02 23:56:21 +00:00
parent 3392940beb
commit 845f44ccef
1 changed files with 9 additions and 7 deletions

View File

@ -383,20 +383,22 @@ void PartitionManagerWidget::onPropertiesPartition()
{
if (selectedPartition())
{
Partition& p = *selectedPartition();
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->newFileSystemType() != selectedPartition()->fileSystem().type() || dlg->forceRecreate())
operationStack().push(new CreateFileSystemOperation(*selectedDevice(), *selectedPartition(), dlg->newFileSystemType()));
if (dlg->newFileSystemType() != p.fileSystem().type() || dlg->forceRecreate())
operationStack().push(new CreateFileSystemOperation(*selectedDevice(), p, dlg->newFileSystemType()));
if (dlg->newLabel() != selectedPartition()->fileSystem().label())
operationStack().push(new SetFileSystemLabelOperation(*selectedPartition(), dlg->newLabel()));
if (dlg->newLabel() != p.fileSystem().label())
operationStack().push(new SetFileSystemLabelOperation(p, dlg->newLabel()));
if (dlg->newFlags() != selectedPartition()->activeFlags())
operationStack().push(new SetPartFlagsOperation(*selectedDevice(), *selectedPartition(), dlg->newFlags()));
if (dlg->newFlags() != p.activeFlags())
operationStack().push(new SetPartFlagsOperation(*selectedDevice(), p, dlg->newFlags()));
updatePartitions();
}