diff options
| author | Robert Knight <[email protected]> | 2007-04-04 17:51:32 +0000 |
|---|---|---|
| committer | Robert Knight <[email protected]> | 2007-04-04 17:51:32 +0000 |
| commit | 3993f382945d92c8b992753eaa764a9e202f0ec9 (patch) | |
| tree | 198bc1e6ead4a3637237d42e7f38673c88132e56 /src/iconsviewsettingspage.cpp | |
| parent | 52c3d5a2228d6496a5d08f4637984e9cf3c9a9f7 (diff) | |
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
Diffstat (limited to 'src/iconsviewsettingspage.cpp')
| -rw-r--r-- | src/iconsviewsettingspage.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/iconsviewsettingspage.cpp b/src/iconsviewsettingspage.cpp index abc9ab56f..54155da50 100644 --- a/src/iconsviewsettingspage.cpp +++ b/src/iconsviewsettingspage.cpp @@ -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); |
