Commit 86b1acec authored by Andrius Štikonas's avatar Andrius Štikonas

Convert remaining cases of old connect syntax.

parent 7d2268c2
......@@ -523,7 +523,7 @@ void KGoldrunner::setupActions()
// Two-handed KB controls and alternate one-handed controls for the hero.
QSignalMapper * kbMapper = new QSignalMapper (this);
connect (kbMapper, SIGNAL (mapped(int)), game, SLOT(kbControl(int)));
connect (kbMapper, static_cast<void(QSignalMapper::*)(int)>(&QSignalMapper::mapped), [&](int dirn) { game->kbControl(dirn); } );
tempMapper = kbMapper;
// The actions for the movement keys are created but disabled. This lets
......
......@@ -507,7 +507,7 @@ void KGrGame::initGame()
// Allow a short break, to display the graphics, then use the demo delay-time
// or the reaction-time to the quick-start dialog to do some more rendering.
QTimer::singleShot (10, scene, SLOT(preRenderSprites()));
QTimer::singleShot (10, scene, &KGrScene::preRenderSprites);
} // End KGrGame::initGame()
......
......@@ -34,7 +34,7 @@
#include <KMessageBox> // TODO - Remove.
#include <KRandomSequence>
KGrLevelPlayer::KGrLevelPlayer (QObject * parent, KRandomSequence * pRandomGen)
KGrLevelPlayer::KGrLevelPlayer (KGrGame * parent, KRandomSequence * pRandomGen)
:
QObject (parent),
game (parent),
......@@ -225,16 +225,13 @@ void KGrLevelPlayer::init (KGrView * view,
}
// Connect the scoring.
connect (hero, SIGNAL (incScore(int)),
game, SLOT (incScore(int)));
connect (hero, &KGrHero::incScore, game, &KGrGame::incScore);
for (KGrEnemy * enemy : qAsConst(enemies)) {
connect (enemy, SIGNAL (incScore(int)),
game, SLOT (incScore(int)));
connect (enemy, &KGrEnemy::incScore, game, &KGrGame::incScore);
}
// Connect the sounds.
connect (hero, SIGNAL (soundSignal(int,bool)),
game, SLOT (playSound(int,bool)));
connect (hero, &KGrHero::soundSignal, game, &KGrGame::playSound);
// Connect the level player to the animation code (for use with dug bricks).
connect (this, &KGrLevelPlayer::startAnimation, view->gameScene(), &KGrScene::startAnimation);
......
......@@ -31,6 +31,7 @@ class KGrLevelGrid;
class KGrRuleBook;
class KGrView;
class KGrHero;
class KGrGame;
class KGrEnemy;
class KRandomSequence;
......@@ -74,7 +75,7 @@ public:
* play.
* @param pRandomGen A shared source of random numbers for all enemies.
*/
KGrLevelPlayer (QObject * parent, KRandomSequence * pRandomGen);
KGrLevelPlayer (KGrGame * parent, KRandomSequence * pRandomGen);
~KGrLevelPlayer();
/**
......@@ -393,7 +394,7 @@ private slots:
void doDig (int button); // Dig using mouse-buttons.
private:
QObject * game;
KGrGame * game;
KRandomSequence * randomGen;
KGrLevelGrid * grid;
KGrRuleBook * rules;
......
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