From: Robert Knight Date: Wed, 4 Apr 2007 17:51:32 +0000 (+0000) Subject: Ensure that the 'Text width' box in the Icon view settings page is always set to... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/3993f382945d92c8b992753eaa764a9e202f0ec9?ds=inline 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 --- 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 #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);