From 191ce6f15612ce9ea5c3e155d37590dd672f41e0 Mon Sep 17 00:00:00 2001 From: Be Date: Fri, 28 Dec 2018 23:27:44 -0600 Subject: [PATCH] use function pointers for Qt connections in ControllerEngine --- src/controllers/engine/controllerengine.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/controllers/engine/controllerengine.cpp b/src/controllers/engine/controllerengine.cpp index 9fb0b89d4eb..a0ac0d2a098 100644 --- a/src/controllers/engine/controllerengine.cpp +++ b/src/controllers/engine/controllerengine.cpp @@ -237,8 +237,8 @@ bool ControllerEngine::loadScriptFiles(const QList& scriptPaths, } } - connect(&m_scriptWatcher, SIGNAL(fileChanged(QString)), - this, SLOT(scriptHasChanged(QString))); + connect(&m_scriptWatcher, &QFileSystemWatcher::fileChanged, + this, &ControllerEngine::scriptHasChanged); emit(initialized()); @@ -248,8 +248,8 @@ bool ControllerEngine::loadScriptFiles(const QList& scriptPaths, // Slot to run when a script file has changed void ControllerEngine::scriptHasChanged(const QString& scriptFilename) { Q_UNUSED(scriptFilename); - disconnect(&m_scriptWatcher, SIGNAL(fileChanged(QString)), - this, SLOT(scriptHasChanged(QString))); + disconnect(&m_scriptWatcher, &QFileSystemWatcher::fileChanged, + this, &ControllerEngine::scriptHasChanged); reloadScripts(); } @@ -402,8 +402,8 @@ void ControllerEngine::scriptErrorDialog(const QString& detailedError) { if (ErrorDialogHandler::instance()->requestErrorDialog(props)) { m_bDisplayingExceptionDialog = true; // Enable custom handling of the dialog buttons - connect(ErrorDialogHandler::instance(), SIGNAL(stdButtonClicked(QString, QMessageBox::StandardButton)), - this, SLOT(errorDialogButton(QString, QMessageBox::StandardButton))); + connect(ErrorDialogHandler::instance(), &ErrorDialogHandler::stdButtonClicked, + this, &ControllerEngine::errorDialogButton); } } @@ -417,10 +417,8 @@ void ControllerEngine::errorDialogButton(const QString& key, QMessageBox::Standa m_bDisplayingExceptionDialog = false; // Something was clicked, so disable this signal now - disconnect(ErrorDialogHandler::instance(), - SIGNAL(stdButtonClicked(QString, QMessageBox::StandardButton)), - this, - SLOT(errorDialogButton(QString, QMessageBox::StandardButton))); + disconnect(ErrorDialogHandler::instance(), &ErrorDialogHandler::stdButtonClicked, + this, &ControllerEngine::errorDialogButton); if (button == QMessageBox::Retry) { reloadScripts();