[gnome-contacts] ContactsContact: remove unused ImDisplay enum



commit a03654fc0628b8324eb9efa855d55971388f6ee0
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Fri Dec 29 02:46:30 2017 +0100

    ContactsContact: remove unused ImDisplay enum

 src/contacts-contact-sheet.vala |    2 +-
 src/contacts-contact.vala       |   24 +++++++-----------------
 2 files changed, 8 insertions(+), 18 deletions(-)
---
diff --git a/src/contacts-contact-sheet.vala b/src/contacts-contact-sheet.vala
index ea363f2..44a3cbe 100644
--- a/src/contacts-contact-sheet.vala
+++ b/src/contacts-contact-sheet.vala
@@ -169,7 +169,7 @@ public class Contacts.ContactSheet : Grid {
        foreach (var protocol in im_details.im_addresses.get_keys ()) {
          foreach (var id in im_details.im_addresses[protocol]) {
            if (p is Tpf.Persona) {
-             var button = add_row_with_button (ref i, Contact.format_im_service (protocol, null), id.value);
+             var button = add_row_with_button (ref i, Contact.format_im_service (protocol), id.value);
              button.clicked.connect (() => {
                  var im_persona = c.find_im_persona (protocol, id.value);
                  if (im_persona != null) {
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index bdc01f7..e2ac68b 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -345,22 +345,16 @@ public class Contacts.Contact : GLib.Object  {
     return null;
   }
 
-  public enum ImDisplay {
-    DEFAULT,           /* $id ($service) */
-    ALIAS_SERVICE      /* $alias ($service) */
-  }
-
   private struct ImData {
     unowned string service;
     unowned string display_name;
-    ImDisplay display;
   }
 
-  public static string format_im_service (string service, out ImDisplay display) {
+  public static string format_im_service (string service) {
     const ImData[] data = {
       { "google-talk", N_("Google Talk") },
       { "ovi-chat", N_("Ovi Chat") },
-      { "facebook", N_("Facebook"), ImDisplay.ALIAS_SERVICE },
+      { "facebook", N_("Facebook") },
       { "lj-talk", N_("Livejournal") },
       { "aim", N_("AOL Instant Messenger") },
       { "gadugadu", N_("Gadu-Gadu") },
@@ -385,14 +379,10 @@ public class Contacts.Contact : GLib.Object  {
       { "zephyr", N_("Zephyr")}
     };
 
-    foreach (var d in data) {
-      if (d.service == service) {
-       display = d.display;
-       return dgettext (Config.GETTEXT_PACKAGE, d.display_name);
-      }
-    }
+    foreach (var d in data)
+      if (d.service == service)
+        return dgettext (Config.GETTEXT_PACKAGE, d.display_name);
 
-    display = ImDisplay.DEFAULT;
     return service;
   }
 
@@ -696,7 +686,7 @@ public class Contacts.Contact : GLib.Object  {
     }
     if (store.type_id == "telepathy") {
       var account = (store as Tpf.PersonaStore).account;
-      return format_im_service (account.service, null);
+      return format_im_service (account.service);
     }
 
     return store.display_name;
@@ -789,7 +779,7 @@ public class Contacts.Contact : GLib.Object  {
     }
     if (store.type_id == "telepathy") {
       var account = (store as Tpf.PersonaStore).account;
-      return format_im_service (account.service, null);
+      return format_im_service (account.service);
     }
 
     return store.display_name;


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