X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fcoreconfigwizard.cpp;h=5119f17d88069bf8b894f2e5929873afa1534032;hp=d2ce4b814027b9cbf4850f102075bceb0afe6cbb;hb=d6f3eedebc7f9619b04dffc5f48faa792950fdcd;hpb=931e5280abc6738f94ac052af2a7e31e82487cf1 diff --git a/src/qtui/coreconfigwizard.cpp b/src/qtui/coreconfigwizard.cpp index d2ce4b81..5119f17d 100644 --- a/src/qtui/coreconfigwizard.cpp +++ b/src/qtui/coreconfigwizard.cpp @@ -27,6 +27,8 @@ #include "coreconfigwizard.h" #include "coreconnection.h" +#include "client.h" + CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QList &backends, const QList &authenticators, QWidget *parent) : QWizard(parent), _connection(connection) @@ -36,7 +38,7 @@ CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QList CoreConfigWizard::backends() const QHash CoreConfigWizard::authenticators() const { - return _authenticators; + return _authenticators; } void CoreConfigWizard::prepareCoreSetup(const QString &backend, const QVariantMap &properties, const QString &authBackend, const QVariantMap &authProperties) @@ -98,7 +100,14 @@ void CoreConfigWizard::prepareCoreSetup(const QString &backend, const QVariantMa foreach(int idx, visitedPages()) page(idx)->setEnabled(false); - coreConnection()->setupCore(Protocol::SetupData(field("adminUser.user").toString(), field("adminUser.password").toString(), backend, authBackend, properties, authProperties)); + // FIXME? We need to be able to set up older cores that don't have auth backend support. + // So if the core doesn't support that feature, don't pass those parameters. + if (!(Client::coreFeatures() & Quassel::AuthBackends)) + { + coreConnection()->setupCore(Protocol::SetupData(field("adminUser.user").toString(), field("adminUser.password").toString(), backend, properties)); + } else { + coreConnection()->setupCore(Protocol::SetupData(field("adminUser.user").toString(), field("adminUser.password").toString(), backend, properties, authBackend, authProperties)); + } } @@ -184,7 +193,13 @@ AdminUserPage::AdminUserPage(QWidget *parent) : QWizardPage(parent) int AdminUserPage::nextId() const { - return CoreConfigWizard::AuthenticationSelectionPage; + // If the core doesn't support auth backends, skip that page! + if (!(Client::coreFeatures() & Quassel::AuthBackends)) + { + return CoreConfigWizard::StorageSelectionPage; + } else { + return CoreConfigWizard::AuthenticationSelectionPage; + } } @@ -510,23 +525,23 @@ void SyncPage::initializePage() complete = false; hasError = false; - // Fill in sync info about the storage layer. + // Fill in sync info about the storage layer. StorageSelectionPage *storagePage = qobject_cast(wizard()->page(CoreConfigWizard::StorageSelectionPage)); QString backend = storagePage->selectedBackend(); QVariantMap properties = storagePage->connectionProperties(); - Q_ASSERT(!backend.isEmpty()); + Q_ASSERT(!backend.isEmpty()); ui.backend->setText(backend); - - // Fill in synci nfo about the authentication layer. - AuthenticationSelectionPage *authPage = qobject_cast(wizard()->page(CoreConfigWizard::AuthenticationSelectionPage)); - QString authBackend = authPage->selectedBackend(); + + // Fill in sync info about the authentication layer. + AuthenticationSelectionPage *authPage = qobject_cast(wizard()->page(CoreConfigWizard::AuthenticationSelectionPage)); + QString authBackend = authPage->selectedBackend(); QVariantMap authProperties = authPage->connectionProperties(); - Q_ASSERT(!authBackend.isEmpty()); + Q_ASSERT(!authBackend.isEmpty()); ui.authBackend->setText(authBackend); ui.user->setText(wizard()->field("adminUser.user").toString()); - emit setupCore(backend, properties, authBackend, authProperties); + emit setupCore(backend, properties, authBackend, authProperties); }