[gnome-contacts] Add Contact.Store.is_empty ()



commit 19010482b0b984d06487a41c5a1bd76fb31904d5
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Aug 22 11:17:21 2011 +0200

    Add Contact.Store.is_empty ()
    
    This takes hidden internals into account considering them not
    in the store.

 src/contacts-store.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-store.vala b/src/contacts-store.vala
index 7c2a70a..cdb7498 100644
--- a/src/contacts-store.vala
+++ b/src/contacts-store.vala
@@ -77,6 +77,14 @@ public class Contacts.Store : GLib.Object {
     return contacts.read_only_view;
   }
 
+  public bool is_empty () {
+    foreach (var contact in contacts) {
+      if (!contact.is_hidden ())
+	return false;
+    }
+    return true;
+  }
+
   private void add (Contact c) {
     contacts.add (c);
     c.changed.connect (contact_changed_cb);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]