modernize: Replace most remaining old-style connects by PMF ones
[quassel.git] / src / qtui / coreconfigwizard.cpp
index c51bd85..e830512 100644 (file)
@@ -29,6 +29,7 @@
 #include "client.h"
 #include "coreconnection.h"
 #include "icon.h"
+#include "util.h"
 
 namespace {
 
@@ -99,7 +100,7 @@ QVariantMap propertiesFromFieldWidgets(QGroupBox *fieldBox, const std::vector<Fi
         QVariant value;
         switch (std::get<2>(fieldInfo).type()) {
             case QVariant::Int: {
-                QSpinBox *spinBox = fieldBox->findChild<QSpinBox *>(key);
+                auto *spinBox = fieldBox->findChild<QSpinBox *>(key);
                 if (spinBox)
                     value = spinBox->value();
                 else
@@ -107,7 +108,7 @@ QVariantMap propertiesFromFieldWidgets(QGroupBox *fieldBox, const std::vector<Fi
                 break;
             }
             case QVariant::String: {
-                QLineEdit *lineEdit = fieldBox->findChild<QLineEdit *>(key);
+                auto *lineEdit = fieldBox->findChild<QLineEdit *>(key);
                 if (lineEdit)
                     value = lineEdit->text();
                 else
@@ -137,11 +138,11 @@ CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QVariantLis
     setPage(AuthenticationSelectionPage, new CoreConfigWizardPages::AuthenticationSelectionPage(authInfos, this));
     setPage(StorageSelectionPage, new CoreConfigWizardPages::StorageSelectionPage(backendInfos, this));
     syncPage = new CoreConfigWizardPages::SyncPage(this);
-    connect(syncPage, SIGNAL(setupCore(const QString &, const QVariantMap &, const QString &, const QVariantMap &)),
-            SLOT(prepareCoreSetup(const QString &, const QVariantMap &, const QString &, const QVariantMap &)));
+    connect(syncPage, &CoreConfigWizardPages::SyncPage::setupCore,
+            this, &CoreConfigWizard::prepareCoreSetup);
     setPage(SyncPage, syncPage);
     syncRelayPage = new CoreConfigWizardPages::SyncRelayPage(this);
-    connect(syncRelayPage, SIGNAL(startOver()), this, SLOT(startOver()));
+    connect(syncRelayPage, &CoreConfigWizardPages::SyncRelayPage::startOver, this, &CoreConfigWizard::startOver);
     setPage(SyncRelayPage, syncRelayPage);
 
     setStartId(IntroPage);
@@ -162,10 +163,10 @@ CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QVariantLis
     setWindowTitle(CoreConfigWizard::tr("Core Configuration Wizard"));
     setPixmap(QWizard::LogoPixmap, icon::get("quassel").pixmap(48));
 
-    connect(connection, SIGNAL(coreSetupSuccess()), SLOT(coreSetupSuccess()));
-    connect(connection, SIGNAL(coreSetupFailed(QString)), SLOT(coreSetupFailed(QString)));
-    connect(connection, SIGNAL(synchronized()), SLOT(syncFinished()));
-    connect(this, SIGNAL(rejected()), connection, SLOT(disconnectFromCore()));
+    connect(connection, &CoreConnection::coreSetupSuccess, this, &CoreConfigWizard::coreSetupSuccess);
+    connect(connection, &CoreConnection::coreSetupFailed, this, &CoreConfigWizard::coreSetupFailed);
+    connect(connection, &CoreConnection::synchronized, this, &CoreConfigWizard::syncFinished);
+    connect(this, &QDialog::rejected, connection, selectOverload<>(&CoreConnection::disconnectFromCore));
 
 
     // Resize all pages to the size hint of the largest one, so the wizard is large enough
@@ -477,13 +478,13 @@ void SyncPage::initializePage()
     emit completeChanged();
 
     // Fill in sync info about the storage layer.
-    StorageSelectionPage *storagePage = qobject_cast<StorageSelectionPage *>(wizard()->page(CoreConfigWizard::StorageSelectionPage));
+    auto *storagePage = qobject_cast<StorageSelectionPage *>(wizard()->page(CoreConfigWizard::StorageSelectionPage));
     QString backend = storagePage->backend();
     QVariantMap backendProperties = storagePage->backendProperties();
     ui.backend->setText(storagePage->displayName());
 
     // Fill in sync info about the authentication layer.
-    AuthenticationSelectionPage *authPage = qobject_cast<AuthenticationSelectionPage *>(wizard()->page(CoreConfigWizard::AuthenticationSelectionPage));
+    auto *authPage = qobject_cast<AuthenticationSelectionPage *>(wizard()->page(CoreConfigWizard::AuthenticationSelectionPage));
     QString authenticator = authPage->authenticator();
     QVariantMap authProperties = authPage->authProperties();
     ui.authenticator->setText(authPage->displayName());