summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2014-12-30 21:02:24 +0100
committerMontel Laurent <[email protected]>2014-12-30 21:03:18 +0100
commit1bb5edec26303a25ff096d1e6747b296d52e4ede (patch)
tree8930e31d910eb424f7d7fa6bfb5e1b56c18ecdec
parentd076f5890c41665ebfe0071a8e8fc46f04e9968f (diff)
Port to new connect api
-rw-r--r--dialogs/fleetdlg.cc2
-rw-r--r--dialogs/scoredlg.cc2
-rw-r--r--gameview.cc16
-rw-r--r--gameview.h2
-rw-r--r--mainwin.cc28
-rw-r--r--planet.cc2
-rw-r--r--sector.cc2
7 files changed, 22 insertions, 32 deletions
diff --git a/dialogs/fleetdlg.cc b/dialogs/fleetdlg.cc
index db8fdd6..a7520fa 100644
--- a/dialogs/fleetdlg.cc
+++ b/dialogs/fleetdlg.cc
@@ -51,7 +51,7 @@ FleetDlg::FleetDlg( QWidget *parent,
update();
setMainWidget( m_fleetTable );
- connect( this, SIGNAL(okClicked()), this, SLOT(accept()) );
+ connect(this, &FleetDlg::okClicked, this, &FleetDlg::accept);
}
diff --git a/dialogs/scoredlg.cc b/dialogs/scoredlg.cc
index 800fdc8..b388649 100644
--- a/dialogs/scoredlg.cc
+++ b/dialogs/scoredlg.cc
@@ -40,7 +40,7 @@ ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, QList<Player *> playe
m_standingsWidget = new StandingsWidget(this, players);
setMainWidget( m_standingsWidget );
- connect( this, SIGNAL(okClicked()), this, SLOT(accept()) );
+ connect(this, &ScoreDlg::okClicked, this, &ScoreDlg::accept);
}
diff --git a/gameview.cc b/gameview.cc
index daa8322..4680c85 100644
--- a/gameview.cc
+++ b/gameview.cc
@@ -160,14 +160,10 @@ GameView::GameView(QWidget *parent, Game *game, QDockWidget *messagesDock, QDock
//**********************************************************************
// Set up signal/slot connections
//**********************************************************************
- connect( m_mapScene, SIGNAL( planetSelected(Planet *) ),
- this, SLOT(planetSelected(Planet *)) );
- connect( m_shipCountEdit, SIGNAL(returnPressed()),
- this, SLOT(newShipCount()) );
- connect( m_standingOrder, SIGNAL(clicked()),
- this, SLOT(standingOrdersClicked()) );
- connect( m_endTurnBtn, SIGNAL( clicked() ),
- this, SLOT( nextPlayer() ) );
+ connect(m_mapScene, &MapScene::planetSelected, this, &GameView::planetSelected);
+ connect(m_shipCountEdit, &QLineEdit::returnPressed, this, &GameView::newShipCount);
+ connect(m_standingOrder, &QCheckBox::clicked, this, &GameView::standingOrdersClicked);
+ connect(m_endTurnBtn, &QPushButton::clicked, this, &GameView::nextPlayer);
changeGameView();
}
@@ -501,10 +497,10 @@ GameView::startNewGame()
LocalPlayer *local = qobject_cast<LocalPlayer*>(player);
if (local)
- connect(local, SIGNAL(canPlay()), this, SLOT(turnPreparation()));
+ connect(local, &LocalPlayer::canPlay, this, &GameView::turnPreparation);
}
- connect(m_game, SIGNAL(finished()), this, SLOT(gameOver()));
+ connect(m_game, &Game::finished, this, &GameView::gameOver);
m_game->start();
// Fix all the widgets to run a new game.
diff --git a/gameview.h b/gameview.h
index 73295d1..3a70012 100644
--- a/gameview.h
+++ b/gameview.h
@@ -81,7 +81,7 @@ public:
virtual ~GameView();
bool confirmNewGame();
-protected slots:
+public slots:
bool shutdownGame();
void planetSelected( Planet * );
void newShipCount();
diff --git a/mainwin.cc b/mainwin.cc
index b8907dc..608b595 100644
--- a/mainwin.cc
+++ b/mainwin.cc
@@ -123,8 +123,8 @@ MainWindow::setupActions()
// the GUI, regardless of currently visible in an active tab or invisible
// in a not currently active tab.
- connect(m_messagesAction, SIGNAL(triggered(bool)), m_messagesDock, SLOT(setVisible(bool)));
- connect(m_messagesDock, SIGNAL(visibilityChanged(bool)), this, SLOT(updateMessagesActionSlot()));
+ connect(m_messagesAction, &QAction::triggered, m_messagesDock, &QDockWidget::setVisible);
+ connect(m_messagesDock, &QDockWidget::visibilityChanged, this, &MainWindow::updateMessagesActionSlot);
// docking area - standings
@@ -139,8 +139,8 @@ MainWindow::setupActions()
m_standingsAction->setCheckable(true);
m_standingsAction->setChecked(m_standingsDock->isVisible());
- connect(m_standingsAction, SIGNAL(triggered(bool)), m_standingsDock, SLOT(setVisible(bool)));
- connect(m_standingsDock, SIGNAL(visibilityChanged(bool)), this, SLOT(updateStandingsActionSlot()));
+ connect(m_standingsAction, &QAction::triggered, m_standingsDock, &QDockWidget::setVisible);
+ connect(m_standingsDock, &QDockWidget::visibilityChanged, this, &MainWindow::updateStandingsActionSlot);
}
@@ -151,19 +151,13 @@ MainWindow::setupGameView()
m_gameView = new GameView(this, m_game, m_messagesDock, m_standingsDock);
setCentralWidget( m_gameView );
- connect ( m_game, SIGNAL( gameMsg(const KLocalizedString &,
- Player *, Planet *,
- Player * ) ),
- m_gameView, SLOT( gameMsg(const KLocalizedString &,
- Player *, Planet *,
- Player * ) ) );
- connect (m_gameView, SIGNAL( newGUIState( GUIState )),
- this, SLOT( guiStateChange( GUIState ) ) );
-
- connect(m_measureAction, SIGNAL(triggered(bool)), m_gameView, SLOT( measureDistance() ));
- connect(m_fleetAction, SIGNAL(triggered(bool)), m_gameView, SLOT( showFleets() ));
- connect(m_endTurnAction, SIGNAL(triggered()), m_gameView, SLOT(nextPlayer()));
- connect(m_endGameAction, SIGNAL(triggered()), m_gameView, SLOT(shutdownGame()));
+ connect(m_game, &Game::gameMsg, m_gameView, &GameView::gameMsg);
+ connect(m_gameView, &GameView::newGUIState, this, &MainWindow::guiStateChange);
+
+ connect(m_measureAction, &QAction::triggered, m_gameView, &GameView::measureDistance);
+ connect(m_fleetAction, &QAction::triggered, m_gameView, &GameView::showFleets);
+ connect(m_endTurnAction, &QAction::triggered, m_gameView, &GameView::nextPlayer);
+ connect(m_endGameAction, &QAction::triggered, m_gameView, &GameView::shutdownGame);
}
diff --git a/planet.cc b/planet.cc
index e68d6a1..51b6198 100644
--- a/planet.cc
+++ b/planet.cc
@@ -46,7 +46,7 @@ Planet::Planet( const QString &planetName, Sector *sector, Player *initialOwner,
{
KRandomSequence r;
m_planetLook = r.getLong(10);
- connect(&m_homeFleet, SIGNAL(update()), this, SIGNAL(update()));
+ connect(&m_homeFleet, &DefenseFleet::update, this, &Planet::update);
m_sector->setPlanet( this );
}
diff --git a/sector.cc b/sector.cc
index 6b9f3bd..161cd92 100644
--- a/sector.cc
+++ b/sector.cc
@@ -54,7 +54,7 @@ void Sector::setPlanet( Planet *planet )
{
m_planet = planet;
- connect( m_planet, SIGNAL( update() ), this, SLOT( childPlanetUpdate() ) );
+ connect(m_planet, &Planet::update, this, &Sector::childPlanetUpdate);
emit update();
}