Casting from ints to widgets and then dereferencing them is bad, mmm-kay?

svn path=/trunk/KDE/kdebase/workspace/; revision=811498
This commit is contained in:
Scott Wheeler 2008-05-23 08:56:56 +00:00
parent 6f981e99ad
commit aa93173086

View file

@ -89,8 +89,13 @@ void PlastikConfig::save(KConfigGroup&)
{
KConfigGroup cg(m_config, "General");
QRadioButton *button = (QRadioButton*)m_dialog->titleAlign->selected();
if (button) cg.writeEntry("TitleAlignment", QString(button->objectName()));
QList<QRadioButton *> buttons = m_dialog->titleAlign->findChildren<QRadioButton *>();
for(QList<QRadioButton *>::ConstIterator it = buttons.begin(); it != buttons.end(); ++it)
{
if((*it)->isChecked())
cg.writeEntry("TitleAlignment", QString((*it)->objectName()));
}
cg.writeEntry("AnimateButtons", m_dialog->animateButtons->isChecked() );
cg.writeEntry("CloseOnMenuDoubleClick", m_dialog->menuClose->isChecked() );
cg.writeEntry("TitleShadow", m_dialog->titleShadow->isChecked() );