Commit cc7e1b99 authored by Denis Kuplyakov's avatar Denis Kuplyakov

Formatted source code.

GIT_SILENT
parent f1ba7270
......@@ -46,18 +46,17 @@ void KReversiView::setGame(KReversiGame *game)
// disconnect signals from previous game if it exists,
// we are not interested in them anymore
if (m_game) {
disconnect( m_game, SIGNAL(boardChanged()), this, SLOT(updateBoard()) );
disconnect( m_game, SIGNAL(moveFinished()), this, SLOT(slotGameMoveFinished()) );
disconnect( m_game, SIGNAL(gameOver()), this, SLOT(slotGameOver()) );
disconnect( m_game, SIGNAL(computerCantMove()), this, SLOT(slotComputerCantMove()) );
disconnect( m_game, SIGNAL(playerCantMove()), this, SLOT(slotPlayerCantMove()) );
disconnect(m_game, SIGNAL(boardChanged()), this, SLOT(updateBoard()));
disconnect(m_game, SIGNAL(moveFinished()), this, SLOT(slotGameMoveFinished()));
disconnect(m_game, SIGNAL(gameOver()), this, SLOT(slotGameOver()));
disconnect(m_game, SIGNAL(computerCantMove()), this, SLOT(slotComputerCantMove()));
disconnect(m_game, SIGNAL(playerCantMove()), this, SLOT(slotPlayerCantMove()));
delete m_game;
}
m_game = game;
if (m_game)
{
if (m_game) {
connect(m_game, SIGNAL(boardChanged()), this, SLOT(updateBoard()));
connect(m_game, SIGNAL(moveFinished()), this, SLOT(slotGameMoveFinished()));
connect(m_game, SIGNAL(gameOver()), this, SLOT(slotGameOver()));
......@@ -193,8 +192,7 @@ void KReversiView::setShowLegalMoves(bool show)
void KReversiView::slotHint()
{
if (!m_game)
{
if (!m_game) {
m_hint = KReversiPos();
return;
}
......@@ -252,16 +250,16 @@ void KReversiView::slotGameOver()
void KReversiView::slotComputerCantMove()
{
QMetaObject::invokeMethod(m_qml_root, "showPopup",
Q_ARG(QVariant,
i18n("Computer can not move. It is your turn again.")));
Q_ARG(QVariant,
i18n("Computer can not move. It is your turn again.")));
}
void KReversiView::slotPlayerCantMove()
{
QMetaObject::invokeMethod(m_qml_root, "showPopup",
Q_ARG(QVariant,
i18n("You can not perform any move. Computer takes next turn now.")));
Q_ARG(QVariant,
i18n("You can not perform any move. Computer takes next turn now.")));
}
void KReversiView::slotOnDelay()
......
......@@ -258,7 +258,7 @@ void KReversiMainWindow::slotNewGame()
QString chipsPrefix = Preferences::useColoredChips() ? QLatin1String("chip_color") : QLatin1String("chip_bw");
m_view = new KReversiView(m_game, this);
setCentralWidget(m_view);
m_view->setAnimationSpeed( Preferences::animationSpeed() );
m_view->setAnimationSpeed(Preferences::animationSpeed());
connect(m_view, SIGNAL(moveFinished()), SLOT(slotMoveFinished()));
} else {
m_view->setGame(m_game);
......
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