From cb2b1a35e14031f15155243aee12fc862cb65ebf Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 22 Feb 2017 14:19:43 +0100 Subject: Fixed kolabnow account setup page. The account plugin supplies the configuration UI, the application supplies the scaffolding. That way we ensure the application doens't contain any account specific code and account configurations are free to offer specialized UI's that work best for them. We're not currently using a standardized controller, but if we did those controllers would have to live with the plugin, not the framework or the components. --- framework/accounts/accountfactory.cpp | 6 ++++++ framework/accounts/accountfactory.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'framework/accounts') diff --git a/framework/accounts/accountfactory.cpp b/framework/accounts/accountfactory.cpp index c590e4b6..9dbb402b 100644 --- a/framework/accounts/accountfactory.cpp +++ b/framework/accounts/accountfactory.cpp @@ -50,6 +50,12 @@ void AccountFactory::setAccountId(const QString &accountId) }).exec(); } +void AccountFactory::setAccountType(const QString &type) +{ + mAccountType = type.toLatin1(); + loadPackage(); +} + void AccountFactory::loadPackage() { auto package = KPackage::PackageLoader::self()->loadPackage("KPackage/GenericQML", "org.kube.accounts." + mAccountType); diff --git a/framework/accounts/accountfactory.h b/framework/accounts/accountfactory.h index 047454ae..b57854e5 100644 --- a/framework/accounts/accountfactory.h +++ b/framework/accounts/accountfactory.h @@ -23,12 +23,13 @@ #include /** - * A factory to instantiate accountp plugins. + * A factory to instantiate account-plugins. */ class AccountFactory : public QObject { Q_OBJECT Q_PROPERTY(QString accountId MEMBER mAccountId WRITE setAccountId); + Q_PROPERTY(QString accountType MEMBER mAccountType WRITE setAccountType); Q_PROPERTY(QString name MEMBER mName READ name NOTIFY accountLoaded); Q_PROPERTY(QString icon MEMBER mIcon NOTIFY accountLoaded); Q_PROPERTY(QString uiPath MEMBER mUiPath NOTIFY accountLoaded); @@ -36,6 +37,7 @@ public: explicit AccountFactory(QObject *parent = Q_NULLPTR); void setAccountId(const QString &); + void setAccountType(const QString &); QString name() const; signals: -- cgit v1.2.3