From: Marja Hassinen Date: Mon, 11 Jan 2010 18:42:35 +0000 (+0200) Subject: Bugfix (segfault when starting a game after finishing all levels). X-Git-Url: https://vcs.maemo.org/git/?p=evilplumber;a=commitdiff_plain;h=24743f70ad94f7f3ee44642ad8fac8cadbca44e1 Bugfix (segfault when starting a game after finishing all levels). If none of the level collections have un-passed levels, none of them got selected in the list widget -> trying to do something with the current item caused a segfault. --- diff --git a/src/game.cpp b/src/game.cpp index 41bff30..6b8aa20 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -594,6 +594,13 @@ void LevelSwitcher::chooseLevelCollection() first = false; } } + + if (first) { + // None of the rows got the focus yet; set it to the first + // item + levelList->setCurrentItem(levelList->item(0)); + } + gameWidget->hide(); startWidget->hide(); levelWidget->show();