X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fcoreconfigwizard.cpp;h=e8305123865ae1f17569f7c37df85a700adde3d5;hp=8225fe47f36e29910f98515ed86dd57a6316f102;hb=6eefdfc697067d184a589fc8a231b16316c09106;hpb=b40672ab5c48b577b31371c159e60d330fdd7ce5 diff --git a/src/qtui/coreconfigwizard.cpp b/src/qtui/coreconfigwizard.cpp index 8225fe47..e8305123 100644 --- a/src/qtui/coreconfigwizard.cpp +++ b/src/qtui/coreconfigwizard.cpp @@ -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(fieldInfo).type()) { case QVariant::Int: { - QSpinBox *spinBox = fieldBox->findChild(key); + auto *spinBox = fieldBox->findChild(key); if (spinBox) value = spinBox->value(); else @@ -107,7 +108,7 @@ QVariantMap propertiesFromFieldWidgets(QGroupBox *fieldBox, const std::vectorfindChild(key); + auto *lineEdit = fieldBox->findChild(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 @@ -318,11 +319,7 @@ AuthenticationSelectionPage::AuthenticationSelectionPage(const QVariantList &aut setSizePolicy({QSizePolicy::Fixed, QSizePolicy::Fixed}); QSizePolicy sp{QSizePolicy::MinimumExpanding, QSizePolicy::Fixed}; -#if QT_VERSION >= 0x050200 sp.setRetainSizeWhenHidden(true); -#else - ui.authSettingsStack->setVisible(true); // ugly hack that will show an empty box, but we'll deprecate Qt4 soon anyway -#endif ui.descriptionStack->setSizePolicy(sp); ui.authSettingsStack->setSizePolicy(sp); @@ -347,11 +344,7 @@ QString AuthenticationSelectionPage::displayName() const QString AuthenticationSelectionPage::authenticator() const { -#if QT_VERSION >= 0x050200 return ui.backendList->currentData().toString(); -#else - return ui.backendList->itemData(ui.backendList->currentIndex()).toString(); -#endif } @@ -424,11 +417,7 @@ StorageSelectionPage::StorageSelectionPage(const QVariantList &backendInfos, QWi setSizePolicy({QSizePolicy::Fixed, QSizePolicy::Fixed}); QSizePolicy sp{QSizePolicy::MinimumExpanding, QSizePolicy::Fixed}; -#if QT_VERSION >= 0x050200 sp.setRetainSizeWhenHidden(true); -#else - ui.storageSettingsStack->setVisible(true); // ugly hack that will show an empty box, but we'll deprecate Qt4 soon anyway -#endif ui.descriptionStack->setSizePolicy(sp); ui.storageSettingsStack->setSizePolicy(sp); @@ -453,11 +442,7 @@ QString StorageSelectionPage::displayName() const QString StorageSelectionPage::backend() const { -#if QT_VERSION >= 0x050200 return ui.backendList->currentData().toString(); -#else - return ui.backendList->itemData(ui.backendList->currentIndex()).toString(); -#endif } @@ -493,13 +478,13 @@ void SyncPage::initializePage() emit completeChanged(); // Fill in sync info about the storage layer. - StorageSelectionPage *storagePage = qobject_cast(wizard()->page(CoreConfigWizard::StorageSelectionPage)); + auto *storagePage = qobject_cast(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(wizard()->page(CoreConfigWizard::AuthenticationSelectionPage)); + auto *authPage = qobject_cast(wizard()->page(CoreConfigWizard::AuthenticationSelectionPage)); QString authenticator = authPage->authenticator(); QVariantMap authProperties = authPage->authProperties(); ui.authenticator->setText(authPage->displayName()); @@ -563,4 +548,4 @@ int SyncRelayPage::nextId() const emit startOver(); return 0; } -}; /* namespace CoreConfigWizardPages */ +} /* namespace CoreConfigWizardPages */