[gnome-contacts] Use individual_can_replace_at_split helper



commit 2b3cb4d0bbd547633216965317e884d3a1b824ff
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Sep 9 15:21:19 2011 +0200

    Use individual_can_replace_at_split helper

 src/contacts-store.vala |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/src/contacts-store.vala b/src/contacts-store.vala
index b44c7c9..f82ab35 100644
--- a/src/contacts-store.vala
+++ b/src/contacts-store.vala
@@ -112,19 +112,12 @@ public class Contacts.Store : GLib.Object {
 	  if (replacements != null) {
 	    Individual? main_individual = null;
 	    foreach (var i in replacements) {
-	      bool new_contact_if_split = false;
-	      foreach (var p in i.personas) {
-		if (p.get_data<bool> ("contacts-new-contact")) {
-		  new_contact_if_split = true;
-		  break;
-		}
-	      }
-
 	      main_individual = i;
-	      // If this was marked new_contact_if_split then we
-	      // need to look for other possible replacements
-	      // that we should reuse, otherwise bail immediately
-	      if (!new_contact_if_split)
+	      // If this was marked as being possible to replace the
+	      // contact on split then we can otherwise bail immediately
+	      // Otherwise need to look for other possible better
+	      // replacements that we should reuse
+	      if (individual_can_replace_at_split (i))
 		break;
 	    }
 



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