[gnome-contacts] Add Contact.persona_has_writable_property helper



commit 6f1ff2b587ec85315b5516ae99d37341c32d00b4
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Aug 26 11:15:52 2011 +0200

    Add Contact.persona_has_writable_property helper

 src/contacts-contact.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index 9a2a359..f10ce99 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -152,6 +152,14 @@ public class Contacts.Contact : GLib.Object  {
     }
   }
 
+  public static bool persona_has_writable_property (Persona persona, string property) {
+    foreach (unowned string p in persona.writeable_properties) {
+      if (p == property)
+	return true;
+    }
+    return false;
+  }
+
   public static string get_display_name_for_persona (Persona persona) {
     var name_details = persona as NameDetails;
     var alias_details = persona as AliasDetails;



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