From: Kevin Wasserman Date: Tue, 17 Sep 2013 16:45:52 +0000 (-0400) Subject: fix HasNonTrivialIdentities X-Git-Tag: 0.7.1~70 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot-ui.git;a=commitdiff_plain;h=7297b4e1e4ebbac6f36ce312f005a3f306f78cf9 fix HasNonTrivialIdentities Now returns true when the current store either has a 'NoIdentity' card with at least one rule or service, or any other identity. --- diff --git a/src/moonshot-identities-manager.vala b/src/moonshot-identities-manager.vala index 51f9d64..e434503 100644 --- a/src/moonshot-identities-manager.vala +++ b/src/moonshot-identities-manager.vala @@ -97,8 +97,16 @@ public class IdentityManagerModel : Object { } public bool HasNonTrivialIdentities() { - var identities = store.get_card_list(); - return !identities.is_empty; + foreach (IdCard card in this.store.get_card_list()) { + // The 'NoIdentity' card is non-trivial if it has services or rules. + // All other cards are automatically non-trivial. + if ((!card.IsNoIdentity()) || + (card.services.length > 0) || + (card.rules.length > 0)) { + return true; + } + } + return false; }