From 3993f382945d92c8b992753eaa764a9e202f0ec9 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Wed, 4 Apr 2007 17:51:32 +0000 Subject: [PATCH] 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 --- src/iconsviewsettingspage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/iconsviewsettingspage.cpp b/src/iconsviewsettingspage.cpp index abc9ab56fe..54155da506 100644 --- a/src/iconsviewsettingspage.cpp +++ b/src/iconsviewsettingspage.cpp @@ -37,6 +37,7 @@ #include #include #include +#include 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);