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);