From 845f44cceffbcfe41baace0e01b67889b7fba144 Mon Sep 17 00:00:00 2001 From: Volker Lanz Date: Tue, 2 Mar 2010 23:56:21 +0000 Subject: [PATCH] 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 --- src/gui/partitionmanagerwidget.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/partitionmanagerwidget.cpp b/src/gui/partitionmanagerwidget.cpp index 834e7af..b62fdbd 100644 --- a/src/gui/partitionmanagerwidget.cpp +++ b/src/gui/partitionmanagerwidget.cpp @@ -383,20 +383,22 @@ void PartitionManagerWidget::onPropertiesPartition() { if (selectedPartition()) { + Partition& p = *selectedPartition(); + Q_ASSERT(selectedDevice()); - QPointer dlg = new PartPropsDialog(this, *selectedDevice(), *selectedPartition()); + QPointer 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(); }