Commit bf07de07 authored by Laurent Montel's avatar Laurent Montel 😁

Normalize signals/slots

svn path=/trunk/KDE/kdegames/kgoldrunner/; revision=1244155
parent 595cadad
......@@ -140,13 +140,13 @@ KGoldrunner::KGoldrunner()
// Connect the game actions to the menu and toolbar displays.
connect (game, SIGNAL (quitGame()), SLOT (close()));
connect (game, SIGNAL (setEditMenu (bool)), SLOT (setEditMenu (bool)));
connect (game, SIGNAL (setEditMenu(bool)), SLOT (setEditMenu(bool)));
connect (game, SIGNAL (hintAvailable(bool)), SLOT (adjustHintAction(bool)));
connect (game, SIGNAL (setAvail (const char *, const bool)),
SLOT (setAvail (const char *, const bool)));
connect (game, SIGNAL (setToggle (const char *, const bool)),
SLOT (setToggle (const char *, const bool)));
connect (game, SIGNAL (setAvail(const char*,bool)),
SLOT (setAvail(const char*,bool)));
connect (game, SIGNAL (setToggle(const char*,bool)),
SLOT (setToggle(const char*,bool)));
// Apply the saved mainwindow settings, if any, and ask the mainwindow
// to automatically save settings if changed: window size, toolbar
......@@ -188,7 +188,7 @@ void KGoldrunner::setupActions()
/**************************************************************************/
QSignalMapper * gameMapper = new QSignalMapper (this);
connect (gameMapper, SIGNAL (mapped (int)), game, SLOT (gameActions (int)));
connect (gameMapper, SIGNAL (mapped(int)), game, SLOT (gameActions(int)));
tempMapper = gameMapper;
// New Game...
......@@ -296,7 +296,7 @@ void KGoldrunner::setupActions()
/**************************************************************************/
QSignalMapper * editMapper = new QSignalMapper (this);
connect (editMapper, SIGNAL (mapped (int)), game, SLOT (editActions (int)));
connect (editMapper, SIGNAL (mapped(int)), game, SLOT (editActions(int)));
tempMapper = editMapper;
// Create a Level
......@@ -370,12 +370,12 @@ void KGoldrunner::setupActions()
KConfigGroup gameGroup (KGlobal::config(), "KDEGame");
QSignalMapper * settingMapper = new QSignalMapper (this);
connect (settingMapper, SIGNAL (mapped (int)), game, SLOT (settings (int)));
connect (settingMapper, SIGNAL (mapped(int)), game, SLOT (settings(int)));
tempMapper = settingMapper;
// Show/Exit Full Screen Mode
KToggleFullScreenAction * fullScreen = KStandardAction::fullScreen
(this, SLOT (viewFullScreen (bool)), this, this);
(this, SLOT (viewFullScreen(bool)), this, this);
actionCollection()->addAction (fullScreen->objectName(), fullScreen);
#ifdef ENABLE_SOUND_SUPPORT
......@@ -512,7 +512,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, SIGNAL (mapped(int)), game, SLOT(kbControl(int)));
tempMapper = kbMapper;
// The actions for the movement keys are created but disabled. This lets
......@@ -553,7 +553,7 @@ void KGoldrunner::setupActions()
return;
QSignalMapper * dbgMapper = new QSignalMapper (this);
connect (dbgMapper, SIGNAL (mapped (int)), game, SLOT(dbgControl (int)));
connect (dbgMapper, SIGNAL (mapped(int)), game, SLOT(dbgControl(int)));
tempMapper = dbgMapper;
keyControl ("do_step", i18n ("Do a Step"), Qt::Key_Period, DO_STEP);
......@@ -586,7 +586,7 @@ KAction * KGoldrunner::gameAction (const QString & name,
if (! key.isEmpty()) {
ga->setShortcut (key);
}
connect (ga, SIGNAL (triggered (bool)), tempMapper, SLOT (map()));
connect (ga, SIGNAL (triggered(bool)), tempMapper, SLOT (map()));
tempMapper->setMapping (ga, code);
return ga;
}
......@@ -601,7 +601,7 @@ KAction * KGoldrunner::editAction (const QString & name,
ed->setText (text);
ed->setToolTip (toolTip);
ed->setWhatsThis (whatsThis);
connect (ed, SIGNAL (triggered (bool)), tempMapper, SLOT (map()));
connect (ed, SIGNAL (triggered(bool)), tempMapper, SLOT (map()));
tempMapper->setMapping (ed, code);
return ed;
}
......@@ -616,7 +616,7 @@ KToggleAction * KGoldrunner::settingAction (const QString & name,
actionCollection()->addAction (name, s);
s->setToolTip (toolTip);
s->setWhatsThis (whatsThis);
connect (s, SIGNAL (triggered (bool)), tempMapper, SLOT (map()));
connect (s, SIGNAL (triggered(bool)), tempMapper, SLOT (map()));
tempMapper->setMapping (s, code);
return s;
}
......@@ -634,7 +634,7 @@ KToggleAction * KGoldrunner::editToolbarAction (const QString & name,
ed->setIconText (shortText);
ed->setToolTip (toolTip);
ed->setWhatsThis (whatsThis);
connect (ed, SIGNAL (triggered (bool)), tempMapper, SLOT (map()));
connect (ed, SIGNAL (triggered(bool)), tempMapper, SLOT (map()));
tempMapper->setMapping (ed, mapCode);
return ed;
}
......@@ -655,7 +655,7 @@ void KGoldrunner::keyControl (const QString & name, const QString & text,
a->setAutoRepeat (false); // Else, prevent QAction signal repeat.
}
connect (a, SIGNAL (triggered (bool)), tempMapper, SLOT (map()));
connect (a, SIGNAL (triggered(bool)), tempMapper, SLOT (map()));
tempMapper->setMapping (a, code);
addAction (a);
}
......@@ -723,8 +723,8 @@ void KGoldrunner::setupThemes()
kDebug()<< "Config() Theme" << currentThemeFilepath;
QSignalMapper * themeMapper = new QSignalMapper (this);
connect (themeMapper, SIGNAL (mapped (const QString &)),
this, SLOT (changeTheme (const QString &)));
connect (themeMapper, SIGNAL (mapped(QString)),
this, SLOT (changeTheme(QString)));
KToggleAction * newTheme; // Action for a theme.
QString actionName; // Name of the theme.
......@@ -749,7 +749,7 @@ void KGoldrunner::setupThemes()
newTheme->setChecked (true); // and mark it as chosen
}
connect (newTheme, SIGNAL(triggered (bool)), themeMapper, SLOT(map()));
connect (newTheme, SIGNAL(triggered(bool)), themeMapper, SLOT(map()));
themeMapper->setMapping (newTheme, filepath); // Add path to signal.
themeList.append (newTheme); // Theme --> menu list.
}
......@@ -782,10 +782,10 @@ void KGoldrunner::initStatusBar()
statusBar()->setItemFixed (ID_LEVEL, -1);
statusBar()->setItemFixed (ID_HINTAVL, -1);
connect (game, SIGNAL (showLives (long)), SLOT (showLives (long)));
connect (game, SIGNAL (showScore (long)), SLOT (showScore (long)));
connect (game, SIGNAL (showLevel (int)), SLOT (showLevel (int)));
connect (game, SIGNAL (gameFreeze (bool)), SLOT (gameFreeze (bool)));
connect (game, SIGNAL (showLives(long)), SLOT (showLives(long)));
connect (game, SIGNAL (showScore(long)), SLOT (showScore(long)));
connect (game, SIGNAL (showLevel(int)), SLOT (showLevel(int)));
connect (game, SIGNAL (gameFreeze(bool)), SLOT (gameFreeze(bool)));
}
void KGoldrunner::showLives (long newLives)
......@@ -1050,8 +1050,8 @@ bool KGoldrunner::queryClose()
void KGoldrunner::setupEditToolbarActions()
{
QSignalMapper * editToolbarMapper = new QSignalMapper (this);
connect (editToolbarMapper, SIGNAL (mapped (int)),
game, SLOT (editToolbarActions (int)));
connect (editToolbarMapper, SIGNAL (mapped(int)),
game, SLOT (editToolbarActions(int)));
tempMapper = editToolbarMapper;
KAction * ed = editAction ("edit_hint", EDIT_HINT,
......
......@@ -124,8 +124,8 @@ KGrCanvas::KGrCanvas (QWidget * parent, const double scale)
m_spotLight = new KGameCanvasPicture (this);
m_fadingTimeLine.setCurveShape (QTimeLine::LinearCurve);
m_fadingTimeLine.setUpdateInterval (60);
connect (&m_fadingTimeLine, SIGNAL (valueChanged (qreal)),
this, SLOT (drawSpotLight (qreal)));
connect (&m_fadingTimeLine, SIGNAL (valueChanged(qreal)),
this, SLOT (drawSpotLight(qreal)));
connect (&m_fadingTimeLine, SIGNAL (finished()),
this, SIGNAL (fadeFinished()));
}
......
......@@ -290,8 +290,8 @@ KGrLGDialog::KGrLGDialog (QFile * savedGames,
lgList-> setItemSelected (lgList->currentItem(), true);
lgHighlight = 0;
connect (lgList, SIGNAL (itemClicked (QListWidgetItem *)),
this, SLOT (lgSelect (QListWidgetItem *)));
connect (lgList, SIGNAL (itemClicked(QListWidgetItem*)),
this, SLOT (lgSelect(QListWidgetItem*)));
}
void KGrLGDialog::lgSelect (QListWidgetItem * item)
......
......@@ -48,14 +48,14 @@ KGrEditor::KGrEditor (KGrCanvas * theView,
// Connect and start the timer.
timer = new QTimer (this);
connect (timer, SIGNAL (timeout ()), this, SLOT (tick ()));
connect (timer, SIGNAL (timeout()), this, SLOT (tick()));
timer->start (TickTime); // TickTime def in kgrglobals.h.
// Connect edit-mode slots to signals from "view".
connect (view, SIGNAL (mouseClick (int)), SLOT (doEdit (int)));
connect (view, SIGNAL (mouseLetGo (int)), SLOT (endEdit (int)));
connect (this, SIGNAL (getMousePos (int &, int &)),
view, SLOT (getMousePos (int &, int &)));
connect (view, SIGNAL (mouseClick(int)), SLOT (doEdit(int)));
connect (view, SIGNAL (mouseLetGo(int)), SLOT (endEdit(int)));
connect (this, SIGNAL (getMousePos(int&,int&)),
view, SLOT (getMousePos(int&,int&)));
}
KGrEditor::~KGrEditor()
......@@ -731,12 +731,12 @@ void KGrEditor::setEditableCell (int i, int j, char type)
void KGrEditor::showEditLevel()
{
// Disconnect play-mode slots from signals from "view".
disconnect (view, SIGNAL (mouseClick (int)), 0, 0);
disconnect (view, SIGNAL (mouseLetGo (int)), 0, 0);
disconnect (view, SIGNAL (mouseClick(int)), 0, 0);
disconnect (view, SIGNAL (mouseLetGo(int)), 0, 0);
// Connect edit-mode slots to signals from "view".
connect (view, SIGNAL (mouseClick (int)), SLOT (doEdit (int)));
connect (view, SIGNAL (mouseLetGo (int)), SLOT (endEdit (int)));
connect (view, SIGNAL (mouseClick(int)), SLOT (doEdit(int)));
connect (view, SIGNAL (mouseLetGo(int)), SLOT (endEdit(int)));
}
bool KGrEditor::reNumberLevels (int cIndex, int first, int last, int inc)
......
......@@ -265,8 +265,8 @@ void KGrGame::editActions (const int action)
emit setEditMenu (true); // Enable edit menu items and toolbar.
// Pass the editor's showLevel signal on to the KGoldrunner GUI object.
connect (editor, SIGNAL (showLevel (int)),
this, SIGNAL (showLevel (int)));
connect (editor, SIGNAL (showLevel(int)),
this, SIGNAL (showLevel(int)));
}
switch (action) {
......@@ -884,8 +884,8 @@ void KGrGame::setupLevelPlayer()
// Use queued connections here, to ensure that levelPlayer has finished
// executing and can be deleted when control goes to the relevant slot.
connect (levelPlayer, SIGNAL (endLevel (const int)),
this, SLOT (endLevel (const int)), Qt::QueuedConnection);
connect (levelPlayer, SIGNAL (endLevel(int)),
this, SLOT (endLevel(int)), Qt::QueuedConnection);
if (playback) {
connect (levelPlayer, SIGNAL (interruptDemo()),
this, SLOT (interruptDemo()), Qt::QueuedConnection);
......
......@@ -151,16 +151,16 @@ void KGrLevelPlayer::init (KGrCanvas * view,
grid->calculateAccess (rules->runThruHole());
// Connect to code that paints grid cells and start-positions of sprites.
connect (this, SIGNAL (paintCell (int, int, char, int)),
view, SLOT (paintCell (int, int, char, int)));
connect (this, SIGNAL (makeSprite (char, int, int)),
view, SLOT (makeSprite (char, int, int)));
connect (this, SIGNAL (paintCell(int,int,char,int)),
view, SLOT (paintCell(int,int,char,int)));
connect (this, SIGNAL (makeSprite(char,int,int)),
view, SLOT (makeSprite(char,int,int)));
// Connect to the mouse-positioning code in the graphics.
connect (this, SIGNAL (getMousePos (int &, int &)),
view, SLOT (getMousePos (int &, int &)));
connect (this, SIGNAL (setMousePos (const int, const int)),
view, SLOT (setMousePos (const int, const int)));
connect (this, SIGNAL (getMousePos(int&,int&)),
view, SLOT (getMousePos(int&,int&)));
connect (this, SIGNAL (setMousePos(int,int)),
view, SLOT (setMousePos(int,int)));
// Show the layout of this level in the view (KGrCanvas).
int wall = ConcreteWall;
......@@ -237,11 +237,11 @@ void KGrLevelPlayer::init (KGrCanvas * view,
}
// Connect the hero's and enemies' efforts to the graphics.
connect (this, SIGNAL (gotGold (int, int, int, bool, bool)),
view, SLOT (gotGold (int, int, int, bool, bool)));
connect (this, SIGNAL (gotGold(int,int,int,bool,bool)),
view, SLOT (gotGold(int,int,int,bool,bool)));
// Connect mouse-clicks from KGrCanvas to digging slot.
connect (view, SIGNAL (mouseClick (int)), SLOT (doDig (int)));
connect (view, SIGNAL (mouseClick(int)), SLOT (doDig(int)));
// Connect the hero and enemies (if any) to the animation code.
connect (hero, SIGNAL (startAnimation (int, bool, int, int, int,
......@@ -256,28 +256,28 @@ void KGrLevelPlayer::init (KGrCanvas * view,
}
// Connect the scoring.
connect (hero, SIGNAL (incScore (const int)),
game, SLOT (incScore (const int)));
connect (hero, SIGNAL (incScore(int)),
game, SLOT (incScore(int)));
foreach (KGrEnemy * enemy, enemies) {
connect (enemy, SIGNAL (incScore (const int)),
game, SLOT (incScore (const int)));
connect (enemy, SIGNAL (incScore(int)),
game, SLOT (incScore(int)));
}
// Connect the sounds.
connect (hero, SIGNAL (soundSignal (const int, const bool)),
game, SLOT (playSound (const int, const bool)));
connect (hero, SIGNAL (soundSignal(int,bool)),
game, SLOT (playSound(int,bool)));
// Connect the level player to the animation code (for use with dug bricks).
connect (this, SIGNAL (startAnimation (int, bool, int, int, int,
Direction, AnimationType)),
view, SLOT (startAnimation (int, bool, int, int, int,
Direction, AnimationType)));
connect (this, SIGNAL (deleteSprite (int)),
view, SLOT (deleteSprite (int)));
connect (this, SIGNAL (deleteSprite(int)),
view, SLOT (deleteSprite(int)));
// Connect the grid to the view, to show hidden ladders when the time comes.
connect (grid, SIGNAL (showHiddenLadders (const QList<int> &, const int)),
view, SLOT (showHiddenLadders (const QList<int> &, const int)));
connect (grid, SIGNAL (showHiddenLadders(QList<int>,int)),
view, SLOT (showHiddenLadders(QList<int>,int)));
// Connect and start the timer. The tick() slot emits signal animation(),
// so there is just one time-source for the model and the view.
......@@ -287,8 +287,8 @@ void KGrLevelPlayer::init (KGrCanvas * view,
timer->pause(); // Pause is ON as level starts.
}
connect (timer, SIGNAL (tick (bool, int)), this, SLOT (tick (bool, int)));
connect (this, SIGNAL (animation (bool)), view, SLOT (animate (bool)));
connect (timer, SIGNAL (tick(bool,int)), this, SLOT (tick(bool,int)));
connect (this, SIGNAL (animation(bool)), view, SLOT (animate(bool)));
if (! playback) {
// Allow some time to view the level before starting a replay.
......
......@@ -299,10 +299,10 @@ void KGrSLDialog::setupWidgets()
connect (games, SIGNAL (itemSelectionChanged()), this, SLOT (slGame()));
connect (display, SIGNAL (valueChanged (const QString &)),
this, SLOT (slUpdate (const QString &)));
connect (display, SIGNAL (valueChanged(QString)),
this, SLOT (slUpdate(QString)));
connect (number, SIGNAL(valueChanged (int)), this, SLOT(slShowLevel (int)));
connect (number, SIGNAL(valueChanged(int)), this, SLOT(slShowLevel(int)));
// Only enable name and hint dialog here if saving a new or edited level.
// At other times the name and hint have not been loaded or initialised yet.
......
......@@ -30,7 +30,7 @@ KGrTimer::KGrTimer (QObject * parent, int pTickTime, float pScale)
expectedTime (0)
{
setScale (pScale);
connect (ticker, SIGNAL (timeout ()), this, SLOT (internalSlot()));
connect (ticker, SIGNAL (timeout()), this, SLOT (internalSlot()));
ticker->start (tickTime);
t.start();
}
......
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