Commit ef2ea798 authored by Rémi Duraffort's avatar Rémi Duraffort

qt4: fix a crash if "view-mode" configuration values are invalid.

parent 1b4f18fd
......@@ -73,6 +73,9 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
getSettings()->beginGroup("Playlist");
int i_savedViewMode = getSettings()->value( "view-mode", TREE_VIEW ).toInt();
getSettings()->endGroup();
/* Limit the saved value to a possible one inside [0, VIEW_COUNT[ */
if(i_savedViewMode < 0 || i_savedViewMode >= VIEW_COUNT)
i_savedViewMode = 0;
showView( i_savedViewMode );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment