Commit 156fc575 authored by Frederik Schwarzer's avatar Frederik Schwarzer

Remove unused code.

parent 844b83fb
......@@ -492,7 +492,7 @@ bool Game::redoMove()
//qDebug() << "Redo a pass move for" << player << undoCmd->text();
playMove(*player, Stone(), false); // E.g. pass move
} else if (undoCmd->moveType() == UndoCommand::MoveType::Resigned) {
// Note: Altough it is possible to undo after a resign and redo it,
// Note: Although it is possible to undo after a resign and redo it,
// it is a bit questionable whether this makes sense logically.
//qDebug() << "Redo a resign for" << player << undoCmd->text();
emit resigned(*player);
......@@ -509,9 +509,6 @@ bool Game::redoMove()
Move Game::lastMove() const
{
Q_ASSERT(!m_movesList.isEmpty());
/*if (m_movesList.isEmpty())
return Move(m_currentPlayer, Stone());
else*/
return m_movesList.last();
}
......@@ -771,7 +768,7 @@ void Game::gameSetup()
{
emit boardInitialized();
}
void Game::readyRead()
{
m_waitAndProcessEvents = false;
......@@ -779,22 +776,6 @@ void Game::readyRead()
void Game::undoIndexChanged(int index)
{
/*int diff = index - m_lastUndoIndex;
//TODO: Fix this ugly mess!
//qDebug() << "Undo stack index changed by " << diff << "...";
// Bigger index changed usually mean that some QUndoView got a MouseClickEvent.
// This means we have to replay more undo/redo steps than normally. If the
// difference is greater than 1 we have to replay diff-1 steps.
if (diff > 1) {
for (int i = 0; i < diff; i++) {
redoMove();
}
} else if (diff < -1) {
for (int i = 0; i > diff; i--) {
undoMove();
}
}*/
m_lastUndoIndex = index;
}
......
......@@ -49,16 +49,6 @@ void GameView::changeCursor(const QPixmap &cursorPixmap)
}
}
/*void GameView::drawForeground(QPainter *painter, const QRectF &rect)
{
if (!isInteractive()) {
painter->save();
painter->setBrush(QBrush(QColor(60,60,60,100), Qt::Dense4Pattern));
painter->drawRect(rect);
painter->restore();
}
}*/
void GameView::showEvent(QShowEvent *)
{
// Make sure that the game scene has the correct size according to the current view
......
......@@ -270,7 +270,7 @@ void MainWindow::finishGame()
m_undoView->setEnabled(false);
// //qDebug() << "Fetching final score from engine ...";
//qDebug() << "Fetching final score from engine ...";
Score score = m_game->estimatedScore();
QString name;
if (score.color() == 'W') {
......@@ -307,8 +307,7 @@ void MainWindow::redo()
void MainWindow::pass()
{
if (m_game->playMove(m_game->currentPlayer())) { // E.g. Pass move
//m_gameScene->showMessage(i18n("Passed move"));
if (m_game->playMove(m_game->currentPlayer())) { // E.g. Pass move
m_gameScene->showHint(false);
}
}
......@@ -316,7 +315,6 @@ void MainWindow::pass()
void MainWindow::hint()
{
m_gameScene->showHint(true);
//m_gameScene->showMessage(i18n("These are the recommended moves..."));
}
void MainWindow::showPreferences()
......@@ -453,9 +451,6 @@ void MainWindow::setupDockWindows()
m_setupWidget = new SetupWidget(m_game, this);
m_setupDock->setWidget(m_setupWidget);
connect(m_setupWidget, &SetupWidget::startClicked, this, &MainWindow::startGame);
//m_setupDock->toggleViewAction()->setText(i18nc("@title:window", "Game setup"));
//m_setupDock->toggleViewAction()->setShortcut(Qt::Key_S);
//actionCollection()->addAction( QLatin1String( "show_setup_panel" ), m_setupDock->toggleViewAction());
addDockWidget(Qt::RightDockWidgetArea, m_setupDock);
// Game dock
......@@ -491,9 +486,6 @@ void MainWindow::setupDockWindows()
auto errorWidget = new ErrorWidget(this);
connect(errorWidget, &ErrorWidget::configureClicked, this, &MainWindow::showPreferences);
m_errorDock->setWidget(errorWidget);
//m_errorDock->toggleViewAction()->setText(i18nc("@title:window", "Error"));
//m_errorDock->toggleViewAction()->setShortcut(Qt::Key_E);
//actionCollection()->addAction( QLatin1String( "show_error_panel" ), m_errorDock->toggleViewAction());
addDockWidget(Qt::BottomDockWidgetArea, m_errorDock);
}
......
......@@ -32,7 +32,6 @@ ErrorWidget::ErrorWidget(QWidget *parent)
setupUi(this);
configureButton->setIcon(QIcon::fromTheme( QStringLiteral( "configure" )));
//QPixmap errorPixmap = QIcon::fromTheme( QLatin1String( "dialog-error" )).pixmap(errorLabel->height(), errorLabel->height());
}
void ErrorWidget::on_configureButton_clicked()
......
......@@ -3,22 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name="kigorc" />
<kcfgfile name="kigorc"/>
<group name="Backend">
<!-- <entry name="EngineList" type="StringList">
<label>List of available/configured engine backends</label>
<choice>GnuGo</choice>
<choice>Aya</choice>
<choice>Brown</choice>
<choice>CrazyStone</choice>
</entry>
<entry name="EngineCommands" type="StringList">
<label>List of backend commands corresponding to the engine list</label>
<choice>gtp -mode gtp</choice>
<choice>aya -mode gtp</choice>
<choice></choice>
<choice></choice>
</entry> -->
<entry name="EngineCommand" type="String">
<label>The current game engine command with (optional) parameters</label>
<default>gnugo --mode gtp</default>
......
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