[gnome-contacts] Break out Contact.format_persona_stores
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Break out Contact.format_persona_stores
- Date: Wed, 18 Jan 2012 16:33:59 +0000 (UTC)
commit 5bf2d38006b93981d9fb5897e1cef45cc522bf50
Author: Alexander Larsson <alexl redhat com>
Date: Wed Jan 18 17:33:15 2012 +0100
Break out Contact.format_persona_stores
src/contacts-contact.vala | 12 ++++++++++++
src/contacts-view.vala | 9 +--------
2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index d7c2aca..aca3867 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -1059,6 +1059,18 @@ public class Contacts.Contact : GLib.Object {
return find_persona_from_store (store.aggregator.primary_store);
}
+ public string format_persona_stores () {
+ string stores = "";
+ bool first = true;
+ foreach (var p in individual.personas) {
+ if (!first)
+ stores += ", ";
+ stores += format_persona_store_name_for_contact (p.store);
+ first = false;
+ }
+ return stores;
+ }
+
public static PersonaStore[] get_eds_address_books () {
PersonaStore[] stores = {};
foreach (var backend in App.app.contacts_store.backend_store.enabled_backends.values) {
diff --git a/src/contacts-view.vala b/src/contacts-view.vala
index d131039..ae26401 100644
--- a/src/contacts-view.vala
+++ b/src/contacts-view.vala
@@ -478,14 +478,7 @@ public class Contacts.ViewWidget : TreeView {
"is_phone", contact.is_phone);
break;
case TextDisplay.STORES:
- string stores = "";
- bool first = true;
- foreach (var p in contact.individual.personas) {
- if (!first)
- stores += ", ";
- stores += Contact.format_persona_store_name_for_contact (p.store);
- first = false;
- }
+ string stores = contact.format_persona_stores ();
cell.set ("name", name,
"show_presence", false,
"message", stores);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]