Ensure that the 'Text width' box in the Icon view settings page is always set to a valid entry initially.

svn path=/trunk/KDE/kdebase/apps/; revision=650484
This commit is contained in:
Robert Knight 2007-04-04 17:51:32 +00:00
parent 52c3d5a222
commit 3993f38294

View file

@ -37,6 +37,7 @@
#include <QPushButton>
#include <QSpinBox>
#include <QGridLayout>
#include <QtDebug>
IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
QWidget* parent) :
@ -99,6 +100,9 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
else {
textWidthIndex = (remainingWidth - TopToBottomBase) / TopToBottomInc;
}
// ensure that chosen index is always valid
textWidthIndex = qMax(textWidthIndex,0);
textWidthIndex = qMin(textWidthIndex,m_textWidthBox->count()-1);
m_textWidthBox->setCurrentIndex(textWidthIndex);