[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/pege
From: Graeme David Gott <graeme () gottcode ! org>
Date: 2009-02-28 17:35:28
Message-ID: 1235842528.005951.4210.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 933337 by ggott:
Fix issues identified by krazy.
M +3 -0 ChangeLog
M +0 -1 pege.desktop
M +1 -1 src/board.h
M +1 -1 src/hole.h
M +14 -8 src/pegeui.rc
M +2 -2 src/puzzle.cpp
M +1 -1 src/window.cpp
--- trunk/playground/games/pege/ChangeLog #933336:933337
@@ -1,3 +1,6 @@
+2009-02-28 Graeme Gott <graeme@gottcode.org>
+ * Fix issues identified by krazy.
+
2009-02-07 Graeme Gott <graeme@gottcode.org>
* Use transparent rectangles to position items.
--- trunk/playground/games/pege/pege.desktop #933336:933337
@@ -10,7 +10,6 @@
GenericName[uk]=Гра в усування фішок
Exec=pege
Icon=pege
-Terminal=false
Type=Application
Terminal=false
Categories=Qt;KDE;Game;BoardGame;
--- trunk/playground/games/pege/src/board.h #933336:933337
@@ -42,7 +42,7 @@
* @param moves Where to store the history of peg movements.
* @param parent The game board's parent widget.
*/
- Board(KUndoStack* moves, QWidget* parent = 0);
+ explicit Board(KUndoStack* moves, QWidget* parent = 0);
/**
* Returns true if there is only one peg left; otherwise returns false.
--- trunk/playground/games/pege/src/hole.h #933336:933337
@@ -35,7 +35,7 @@
* @param position The location of the hole.
* @param parent The parent item of the hole.
*/
- Hole(const QPoint& position, QGraphicsItem* parent = 0);
+ explicit Hole(const QPoint& position, QGraphicsItem* parent = 0);
/**
* Returns true if the hole has a peg.
--- trunk/playground/games/pege/src/pegeui.rc #933336:933337
@@ -1,11 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui name="pege" version="1">
-<ToolBar name="mainToolBar"><text>Main Toolbar</text>
- <Action name="game_new"/>
- <Action name="game_restart"/>
- <Separator/>
- <Action name="move_undo"/>
- <Action name="move_redo"/>
-</ToolBar>
+<gui name="pege"
+ version="2"
+ xmlns="http://www.kde.org/standards/kxmlgui/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 \
http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd"> + <MenuBar />
+ <ToolBar name="mainToolBar">
+ <text>Main Toolbar</text>
+ <Action name="game_new"/>
+ <Action name="game_restart"/>
+ <Separator/>
+ <Action name="move_undo"/>
+ <Action name="move_redo"/>
+ </ToolBar>
</gui>
--- trunk/playground/games/pege/src/puzzle.cpp #933336:933337
@@ -101,7 +101,7 @@
bool Puzzle::findNextMove(const QPoint& start_hole, QPoint& jumped_hole, QPoint& \
end_hole) { std::random_shuffle(m_directions.begin(), m_directions.end());
- foreach (QPoint direction, m_directions) {
+ foreach (const QPoint& direction, m_directions) {
jumped_hole = direction + start_hole;
end_hole = (direction * 2) + start_hole;
if (isAvailable(jumped_hole) && isAvailable(end_hole)) {
@@ -123,7 +123,7 @@
QPoint jumped_hole, end_hole;
for (int i = 0; i < loops; ++i) {
shuffle(pegs);
- foreach (QPoint start_hole, pegs) {
+ foreach (const QPoint& start_hole, pegs) {
if (findNextMove(start_hole, jumped_hole, end_hole)) {
pegs.removeOne(start_hole);
pegs.append(jumped_hole);
--- trunk/playground/games/pege/src/window.cpp #933336:933337
@@ -184,7 +184,7 @@
// Load moves
QRegExp parse("(-?\\d+)x(-?\\d+):(-?\\d+)x(-?\\d+)");
- foreach (QString move, moves) {
+ foreach (const QString& move, moves) {
if (!parse.exactMatch(move)) {
continue;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic