Commit e446c132 authored by Denis Kuplyakov's avatar Denis Kuplyakov

Cleaned up code

Deleted "if (true)" statement and useless comment.

GIT_SILENT
parent cc7e1b99
...@@ -144,9 +144,6 @@ public slots: ...@@ -144,9 +144,6 @@ public slots:
return m_demoMode; return m_demoMode;
} }
private slots: private slots:
/**
* @brief slotGameMoveFinished
*/
void slotGameMoveFinished(); void slotGameMoveFinished();
void slotGameOver(); void slotGameOver();
void slotComputerCantMove(); void slotComputerCantMove();
......
...@@ -330,24 +330,22 @@ void KReversiMainWindow::slotMoveFinished() ...@@ -330,24 +330,22 @@ void KReversiMainWindow::slotMoveFinished()
void KReversiMainWindow::slotUndo() void KReversiMainWindow::slotUndo()
{ {
if (true) { //!m_scene->isBusy() ) // scene will automatically notice that it needs to update
// scene will automatically notice that it needs to update int numUndone = m_game->undo();
int numUndone = m_game->undo(); // remove last numUndone items from historyView
// remove last numUndone items from historyView for (int i = 0; i < numUndone; ++i)
for (int i = 0; i < numUndone; ++i) delete m_historyView->takeItem(m_historyView->count() - 1);
delete m_historyView->takeItem(m_historyView->count() - 1);
QListWidgetItem *last = m_historyView->item(m_historyView->count() - 1); QListWidgetItem *last = m_historyView->item(m_historyView->count() - 1);
m_historyView->setCurrentItem(last); m_historyView->setCurrentItem(last);
m_historyView->scrollToItem(last); m_historyView->scrollToItem(last);
updateScores(); updateScores();
m_undoAct->setEnabled(m_game->canUndo()); m_undoAct->setEnabled(m_game->canUndo());
// if the user hits undo after game is over // if the user hits undo after game is over
// let's give him a chance to ask for a hint ;) // let's give him a chance to ask for a hint ;)
m_hintAct->setEnabled(true); m_hintAct->setEnabled(true);
}
} }
void KReversiMainWindow::slotHighscores() void KReversiMainWindow::slotHighscores()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment