From 1c97342be314846878e97108ad1ac0a46fe6ccf2 Mon Sep 17 00:00:00 2001 From: Volker Lanz Date: Tue, 27 Apr 2010 13:19:34 +0000 Subject: [PATCH] if the file system we want to set the combo box to cannot be found in it, set it to the first value; don't set it to -1 svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119609 --- TODO | 2 -- src/config/generalpagewidget.cpp | 3 ++- src/gui/newdialog.cpp | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index a7f70fd..1401cfc 100644 --- a/TODO +++ b/TODO @@ -9,8 +9,6 @@ Plans and ideas for 1.1: Bugs to fix for 1.1: -* make sure the default file system can indeed be created - * handling of illegal values in the size dialog spin boxes is not correct: we need to make use of the validator, not just overwrite with the previous value if the new one is not legal. i.e., we must constantly update the valid ranges diff --git a/src/config/generalpagewidget.cpp b/src/config/generalpagewidget.cpp index fd14955..88721b5 100644 --- a/src/config/generalpagewidget.cpp +++ b/src/config/generalpagewidget.cpp @@ -42,7 +42,8 @@ FileSystem::Type GeneralPageWidget::defaultFileSystem() const void GeneralPageWidget::setDefaultFileSystem(FileSystem::Type t) { - comboDefaultFileSystem().setCurrentIndex(comboDefaultFileSystem().findText(FileSystem::nameForType(t))); + const int idx = comboDefaultFileSystem().findText(FileSystem::nameForType(t)); + comboDefaultFileSystem().setCurrentIndex(idx != -1 ? idx : 0); } QString GeneralPageWidget::backend() const diff --git a/src/gui/newdialog.cpp b/src/gui/newdialog.cpp index 5733dd3..d808e32 100644 --- a/src/gui/newdialog.cpp +++ b/src/gui/newdialog.cpp @@ -72,7 +72,8 @@ void NewDialog::setupDialog() dialogWidget().comboFileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName); QString selected = FileSystem::nameForType(FileSystem::defaultFileSystem()); - dialogWidget().comboFileSystem().setCurrentIndex(dialogWidget().comboFileSystem().findText(selected)); + const int idx = dialogWidget().comboFileSystem().findText(selected); + dialogWidget().comboFileSystem().setCurrentIndex(idx != -1 ? idx : 0); dialogWidget().radioPrimary().setVisible(partitionRoles() & PartitionRole::Primary); dialogWidget().radioExtended().setVisible(partitionRoles() & PartitionRole::Extended);