]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Ensure that the 'Text width' box in the Icon view settings page is always set to...
authorRobert Knight <robertknight@gmail.com>
Wed, 4 Apr 2007 17:51:32 +0000 (17:51 +0000)
committerRobert Knight <robertknight@gmail.com>
Wed, 4 Apr 2007 17:51:32 +0000 (17:51 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=650484

src/iconsviewsettingspage.cpp

index abc9ab56feafbdc5d67a6cc56d04950ca867d500..54155da506832f20f66735913aa90490c06b6596 100644 (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);