This is an automatically generated e-mail. To reply, visit: http://svn.reviewboard.kde.org/r/5617/

On October 26th, 2010, 8:12 a.m., Marco Martin wrote:

/trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/fifteen.cpp (Diff revision 1)
Fifteen::Fifteen(QGraphicsItem* parent, int size)
35
      m_size(0), // this will get overwritten in setSize(), but needs an initial value
36
      m_size(0), // this will get overwritten in setSize(), but needs an initial value
shouldn't be 0
The reason I set it to 0 here is that I have to call setSize(size) later, and that doesn't do anything if size == m_size.
It should be safe though, because nothing uses m_size between here and the call to setSize(size). I've updated the comment to make this more clear.

On October 26th, 2010, 8:12 a.m., Marco Martin wrote:

/trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/fifteen.cpp (Diff revision 1)
void Fifteen::setSize(int size)
59
    m_size = size;
60
    m_size = size;
m_size = qMax(size, 1)
you added several foo % m_size, ensuring isn't 0 is important :)
Good point, thanks. I've just fixed in my local copy.
I'll commit in a few minutes.

- Anthony


On October 13th, 2010, 1:40 p.m., Anthony Bryant wrote:

Review request for Plasma.
By Anthony Bryant.

Updated 2010-10-13 13:40:36

Description

Lots more improvements to the fifteen puzzle:
* Improved shuffle algorithm
* Resize fonts when the board size is changed
* Better checking for whether the board is solved
* Stop the pieces flickering when they are moved
* Changed the way board positions are stored
* Animate in the blank piece when the puzzle is solved
* Add a status bar underneath the puzzle, which shows a shuffle button and the time elapsed

Testing

Solved the puzzle a few times, changed some settings, resized the applet.
Bugs: 156648

Diffs

  • /trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/fifteen.h (1185297)
  • /trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/fifteen.cpp (1185297)
  • /trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/fifteenPuzzle.h (1185297)
  • /trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/fifteenPuzzle.cpp (1185297)
  • /trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/piece.h (1185297)
  • /trunk/KDE/kdeplasma-addons/applets/fifteenPuzzle/src/piece.cpp (1185297)

View Diff

Screenshots

new puzzle layout