summaryrefslogtreecommitdiffstats
path: root/framework/src/accounts/accountfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/accounts/accountfactory.cpp')
-rw-r--r--framework/src/accounts/accountfactory.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/framework/src/accounts/accountfactory.cpp b/framework/src/accounts/accountfactory.cpp
index 7f3f046d..c3c3a170 100644
--- a/framework/src/accounts/accountfactory.cpp
+++ b/framework/src/accounts/accountfactory.cpp
@@ -64,17 +64,20 @@ void AccountFactory::loadPackage()
64 }(); 64 }();
65 mUiPath.clear(); 65 mUiPath.clear();
66 mLoginUi.clear(); 66 mLoginUi.clear();
67 mAccountName.clear();
67 mRequiresKeyring = false; 68 mRequiresKeyring = false;
68 if (pluginPath.isEmpty()) { 69 if (pluginPath.isEmpty()) {
69 qWarning() << "Failed to load account package: " << "org.kube.accounts." + mAccountType; 70 qWarning() << "Failed to load account package: " << "org.kube.accounts." + mAccountType;
70 } else { 71 } else {
71 mUiPath = QUrl::fromLocalFile(pluginPath + "/AccountSettings.qml"); 72 mUiPath = QUrl::fromLocalFile(pluginPath + "/AccountSettings.qml");
72 mLoginUi = QUrl::fromLocalFile(pluginPath + "/Login.qml"); 73 mLoginUi = QUrl::fromLocalFile(pluginPath + "/Login.qml");
74 mAccountName = mAccountType;
73 if (QFileInfo::exists(pluginPath + "/metadata.json")) { 75 if (QFileInfo::exists(pluginPath + "/metadata.json")) {
74 QFile file{pluginPath + "/metadata.json"}; 76 QFile file{pluginPath + "/metadata.json"};
75 file.open(QIODevice::ReadOnly); 77 file.open(QIODevice::ReadOnly);
76 auto json = QJsonDocument::fromJson(file.readAll()); 78 auto json = QJsonDocument::fromJson(file.readAll());
77 mRequiresKeyring = json.object().value("RequiresKeyring").toBool(true); 79 mRequiresKeyring = json.object().value("RequiresKeyring").toBool(true);
80 mAccountName = json.object().value("Name").toString();
78 } else { 81 } else {
79 mRequiresKeyring = true; 82 mRequiresKeyring = true;
80 } 83 }