[Kde-games-devel] KDE/kdegames/kdiamond/src

Stefan Majewsky majewsky at gmx.net
Mon Feb 1 20:57:35 CET 2010


SVN commit 1083694 by majewsky:

Do the KGameDifficulty initialisation before setupGUI().

This is needed to have the difficulty selector appear on screen.
Strangely, this seemed to have worked once, but it was broken now.
Thx to Burkhard Lück who noticed that the documentation was not updated
when the regression was introduced. ;-)

CCMAIL: kde-games-devel at kde.org
CCMAIL: lueck at hube-lueck.de

 M  +0 -3      kdiamondui.rc  
 M  +7 -7      mainwindow.cpp  


--- trunk/KDE/kdegames/kdiamond/src/kdiamondui.rc #1083693:1083694
@@ -6,9 +6,6 @@
      xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
                          http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd">
 	<MenuBar>
-		<Menu name="settings">
-			<Action name="untimed"/>
-		</Menu>
 	</MenuBar>
 	<ToolBar name="mainToolBar">
 		<text>Main Toolbar</text>
--- trunk/KDE/kdegames/kdiamond/src/mainwindow.cpp #1083693:1083694
@@ -70,6 +70,13 @@
 	m_hintAct = KStandardGameAction::hint(0, 0, actionCollection());
 	KStandardAction::preferences(this, SLOT(configureSettings()), actionCollection());
 	KStandardAction::configureNotifications(this, SLOT(configureNotifications()), actionCollection());
+	//difficulty
+	KGameDifficulty::init(this, this, SLOT(startGameDispatcher()));
+	KGameDifficulty::addStandardLevel(KGameDifficulty::VeryEasy);
+	KGameDifficulty::addStandardLevel(KGameDifficulty::Easy);
+	KGameDifficulty::addStandardLevel(KGameDifficulty::Medium);
+	KGameDifficulty::addStandardLevel(KGameDifficulty::Hard);
+	KGameDifficulty::addStandardLevel(KGameDifficulty::VeryHard);
 	//late GUI initialisation
 	setupGUI(QSize(300, 400)); //TODO: find better solution for a minimum size
 	setCaption(i18nc("The application's name", "KDiamond"));
@@ -80,13 +87,6 @@
 	connect(m_game, SIGNAL(stateChanged(KDiamond::State)), this, SLOT(stateChange(KDiamond::State)));
 	connect(m_game, SIGNAL(pointsChanged(int)), m_infoBar, SLOT(updatePoints(int)));
 	connect(m_game, SIGNAL(leftTimeChanged(int)), m_infoBar, SLOT(updateRemainingTime(int)));
-	//difficulty
-	KGameDifficulty::init(this, this, SLOT(startGameDispatcher()));
-	KGameDifficulty::addStandardLevel(KGameDifficulty::VeryEasy);
-	KGameDifficulty::addStandardLevel(KGameDifficulty::Easy);
-	KGameDifficulty::addStandardLevel(KGameDifficulty::Medium);
-	KGameDifficulty::addStandardLevel(KGameDifficulty::Hard);
-	KGameDifficulty::addStandardLevel(KGameDifficulty::VeryHard);
 	//selected skill
 	int skill = Settings::skill();
 	if (skill < KGameDifficulty::VeryEasy) //includes default values like 0 or 1


More information about the kde-games-devel mailing list