diff options
Diffstat (limited to 'framework/accounts')
-rw-r--r-- | framework/accounts/accountfactory.cpp | 6 | ||||
-rw-r--r-- | framework/accounts/accountfactory.h | 4 |
2 files changed, 9 insertions, 1 deletions
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) | |||
50 | }).exec(); | 50 | }).exec(); |
51 | } | 51 | } |
52 | 52 | ||
53 | void AccountFactory::setAccountType(const QString &type) | ||
54 | { | ||
55 | mAccountType = type.toLatin1(); | ||
56 | loadPackage(); | ||
57 | } | ||
58 | |||
53 | void AccountFactory::loadPackage() | 59 | void AccountFactory::loadPackage() |
54 | { | 60 | { |
55 | auto package = KPackage::PackageLoader::self()->loadPackage("KPackage/GenericQML", "org.kube.accounts." + mAccountType); | 61 | 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 @@ | |||
23 | #include <QVariant> | 23 | #include <QVariant> |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * A factory to instantiate accountp plugins. | 26 | * A factory to instantiate account-plugins. |
27 | */ | 27 | */ |
28 | class AccountFactory : public QObject | 28 | class AccountFactory : public QObject |
29 | { | 29 | { |
30 | Q_OBJECT | 30 | Q_OBJECT |
31 | Q_PROPERTY(QString accountId MEMBER mAccountId WRITE setAccountId); | 31 | Q_PROPERTY(QString accountId MEMBER mAccountId WRITE setAccountId); |
32 | Q_PROPERTY(QString accountType MEMBER mAccountType WRITE setAccountType); | ||
32 | Q_PROPERTY(QString name MEMBER mName READ name NOTIFY accountLoaded); | 33 | Q_PROPERTY(QString name MEMBER mName READ name NOTIFY accountLoaded); |
33 | Q_PROPERTY(QString icon MEMBER mIcon NOTIFY accountLoaded); | 34 | Q_PROPERTY(QString icon MEMBER mIcon NOTIFY accountLoaded); |
34 | Q_PROPERTY(QString uiPath MEMBER mUiPath NOTIFY accountLoaded); | 35 | Q_PROPERTY(QString uiPath MEMBER mUiPath NOTIFY accountLoaded); |
@@ -36,6 +37,7 @@ public: | |||
36 | explicit AccountFactory(QObject *parent = Q_NULLPTR); | 37 | explicit AccountFactory(QObject *parent = Q_NULLPTR); |
37 | 38 | ||
38 | void setAccountId(const QString &); | 39 | void setAccountId(const QString &); |
40 | void setAccountType(const QString &); | ||
39 | QString name() const; | 41 | QString name() const; |
40 | 42 | ||
41 | signals: | 43 | signals: |