diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-27 09:43:37 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-27 09:43:37 +0200 |
commit | 5f1cf5b7926c568998f213beba9d7932ef7742ef (patch) | |
tree | eea6dbe854c7161dbf8d28ca6bbc0e0b8b7021de /framework/accounts/accountsmodel.cpp | |
parent | 2b0278a02b8bb5de9da79de395942c55449c1c59 (diff) | |
download | kube-5f1cf5b7926c568998f213beba9d7932ef7742ef.tar.gz kube-5f1cf5b7926c568998f213beba9d7932ef7742ef.zip |
Use states for the account status icon
Diffstat (limited to 'framework/accounts/accountsmodel.cpp')
-rw-r--r-- | framework/accounts/accountsmodel.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/framework/accounts/accountsmodel.cpp b/framework/accounts/accountsmodel.cpp index f0487f4f..d999bdbd 100644 --- a/framework/accounts/accountsmodel.cpp +++ b/framework/accounts/accountsmodel.cpp | |||
@@ -45,8 +45,6 @@ QHash< int, QByteArray > AccountsModel::roleNames() const | |||
45 | roles[Icon] = "icon"; | 45 | roles[Icon] = "icon"; |
46 | roles[AccountId] = "accountId"; | 46 | roles[AccountId] = "accountId"; |
47 | roles[Status] = "status"; | 47 | roles[Status] = "status"; |
48 | roles[StatusIcon] = "statusIcon"; | ||
49 | roles[ShowStatus] = "showStatus"; | ||
50 | 48 | ||
51 | return roles; | 49 | return roles; |
52 | } | 50 | } |
@@ -63,17 +61,15 @@ QVariant AccountsModel::data(const QModelIndex &idx, int role) const | |||
63 | case AccountId: | 61 | case AccountId: |
64 | return account->identifier(); | 62 | return account->identifier(); |
65 | case Status: | 63 | case Status: |
66 | return account->getStatus(); | 64 | switch (account->getStatus()) { |
67 | case StatusIcon: | 65 | case Sink::ApplicationDomain::ErrorStatus: |
68 | if (account->getStatus() == Sink::ApplicationDomain::ErrorStatus) { | 66 | return ErrorStatus; |
69 | return "emblem-error"; | 67 | case Sink::ApplicationDomain::BusyStatus: |
70 | } else if (account->getStatus() == Sink::ApplicationDomain::BusyStatus) { | 68 | return BusyStatus; |
71 | return "view-refresh"; | 69 | case Sink::ApplicationDomain::ConnectedStatus: |
72 | } else if (account->getStatus() == Sink::ApplicationDomain::ConnectedStatus) { | 70 | return ConnectedStatus; |
73 | return "checkmark"; | ||
74 | } | 71 | } |
75 | case ShowStatus: | 72 | return OfflineStatus; |
76 | return (account->getStatus() != Sink::ApplicationDomain::OfflineStatus); | ||
77 | } | 73 | } |
78 | return QIdentityProxyModel::data(idx, role); | 74 | return QIdentityProxyModel::data(idx, role); |
79 | } | 75 | } |