From 24743f70ad94f7f3ee44642ad8fac8cadbca44e1 Mon Sep 17 00:00:00 2001 From: Marja Hassinen Date: Mon, 11 Jan 2010 20:42:35 +0200 Subject: [PATCH] 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. --- src/game.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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(); -- 1.7.9.5