diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-15 10:50:50 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-15 10:50:50 +0100 |
commit | 8318b29b81d9a98fc5ad5fe1550f6d7a46ca7296 (patch) | |
tree | c79777e16054d261c1fcd2d5852fd19039c750fd | |
parent | 98be2021274587a99bf7a30c114259f3ae8a65d1 (diff) | |
download | kube-8318b29b81d9a98fc5ad5fe1550f6d7a46ca7296.tar.gz kube-8318b29b81d9a98fc5ad5fe1550f6d7a46ca7296.zip |
Fixed loading of account names.
-rw-r--r-- | accounts/maildir/package/contents/ui/MaildirAccountSettings.qml | 6 | ||||
-rw-r--r-- | framework/domain/accountsmodel.cpp | 2 | ||||
-rw-r--r-- | framework/settings/settings.cpp | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml index 3b2dbd35..174683c4 100644 --- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml | |||
@@ -49,8 +49,8 @@ Rectangle { | |||
49 | id: name | 49 | id: name |
50 | placeholderText: accountName | 50 | placeholderText: accountName |
51 | Layout.fillWidth: true | 51 | Layout.fillWidth: true |
52 | text: accountSettings.name | 52 | text: accountSettings.accountName |
53 | onTextChanged: { accountSettings.name = text; } | 53 | onTextChanged: { accountSettings.accountName = text; } |
54 | } | 54 | } |
55 | 55 | ||
56 | Text { | 56 | Text { |
@@ -152,7 +152,7 @@ Rectangle { | |||
152 | KubeSettings.Settings { | 152 | KubeSettings.Settings { |
153 | id: accountSettings | 153 | id: accountSettings |
154 | identifier: "account." + accountId | 154 | identifier: "account." + accountId |
155 | property string name; | 155 | property string accountName; |
156 | property string icon: root.icon; | 156 | property string icon: root.icon; |
157 | } | 157 | } |
158 | 158 | ||
diff --git a/framework/domain/accountsmodel.cpp b/framework/domain/accountsmodel.cpp index 96306464..b5eafd53 100644 --- a/framework/domain/accountsmodel.cpp +++ b/framework/domain/accountsmodel.cpp | |||
@@ -50,7 +50,7 @@ QVariant AccountsModel::data(const QModelIndex &idx, int role) const | |||
50 | Kube::Account accountSettings(identifier.toLatin1()); | 50 | Kube::Account accountSettings(identifier.toLatin1()); |
51 | switch (role) { | 51 | switch (role) { |
52 | case Name: | 52 | case Name: |
53 | return accountSettings.property("name").toString(); | 53 | return accountSettings.property("accountName").toString(); |
54 | case Icon: | 54 | case Icon: |
55 | return accountSettings.property("icon").toString(); | 55 | return accountSettings.property("icon").toString(); |
56 | case AccountId: | 56 | case AccountId: |
diff --git a/framework/settings/settings.cpp b/framework/settings/settings.cpp index 64bc28ba..00d1b9c5 100644 --- a/framework/settings/settings.cpp +++ b/framework/settings/settings.cpp | |||
@@ -65,14 +65,14 @@ void Settings::save() | |||
65 | 65 | ||
66 | for (const auto &p : dynamicPropertyNames()) { | 66 | for (const auto &p : dynamicPropertyNames()) { |
67 | qWarning() << "setting " << p << property(p); | 67 | qWarning() << "setting " << p << property(p); |
68 | if (p == "identifier") { | 68 | if (p == "identifier" || p == "name") { |
69 | continue; | 69 | continue; |
70 | } | 70 | } |
71 | settings->setValue(p, property(p)); | 71 | settings->setValue(p, property(p)); |
72 | } | 72 | } |
73 | for (int i = metaObject()->propertyOffset(); i < metaObject()->propertyCount(); i++) { | 73 | for (int i = metaObject()->propertyOffset(); i < metaObject()->propertyCount(); i++) { |
74 | const auto p = metaObject()->property(i).name(); | 74 | const auto p = metaObject()->property(i).name(); |
75 | if (p == QByteArray("identifier")) { | 75 | if (p == QByteArray("identifier") || p == QByteArray("name")) { |
76 | continue; | 76 | continue; |
77 | } | 77 | } |
78 | qWarning() << "setting " << p << property(p); | 78 | qWarning() << "setting " << p << property(p); |
@@ -88,7 +88,7 @@ void Settings::remove() | |||
88 | 88 | ||
89 | void Settings::load() | 89 | void Settings::load() |
90 | { | 90 | { |
91 | if (mLoaded) { | 91 | if (mLoaded || mIdentifier.isEmpty() || mIdentifier.endsWith(".")) { |
92 | return; | 92 | return; |
93 | } | 93 | } |
94 | mLoaded = true; | 94 | mLoaded = true; |