Commit 26c0d12f authored by Erwan Tulou's avatar Erwan Tulou

qt4(Win32): correct crash when saving preferences

The way options are stored in a list by append and retrieve by named index
(enum list) is kind of risky. Errors can easily occur, some are obvious
 (crash), others may be more silent.
parent 58f5726f
......@@ -519,6 +519,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
optionWidgets.append( ui.stylesCombo );
#else
ui.stylesCombo->hide();
optionWidgets.append( NULL );
#endif
ui.skins_zone->setEnabled( ui.skins->isChecked() );
......@@ -760,8 +761,9 @@ void SPrefsPanel::apply()
config_PutPsz( p_intf, "intf", "skins2" );
if( qobject_cast<QRadioButton *>(optionWidgets[qtRB])->isChecked() )
config_PutPsz( p_intf, "intf", "qt" );
getSettings()->setValue( "MainWindow/QtStyle",
qobject_cast<QComboBox *>(optionWidgets[styleCB])->currentText() );
if( qobject_cast<QComboBox *>(optionWidgets[styleCB]) )
getSettings()->setValue( "MainWindow/QtStyle",
qobject_cast<QComboBox *>(optionWidgets[styleCB])->currentText() );
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment