[folks] Rename HasPresence -> PresenceOwner.



commit cea73b98512bb82a81b67fc1bbbf147543c8f046
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Wed Dec 22 18:52:55 2010 -0800

    Rename HasPresence -> PresenceOwner.
    
    Fixes bgo#627397.

 NEWS                                             |    2 ++
 backends/telepathy/lib/tpf-persona.vala          |    6 +++---
 folks/Makefile.am                                |    2 +-
 folks/individual.vala                            |    8 ++++----
 folks/{has-presence.vala => presence-owner.vala} |   17 +++++++++--------
 tests/telepathy/individual-properties.vala       |    2 +-
 6 files changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/NEWS b/NEWS
index fff8d54..d9de3f7 100644
--- a/NEWS
+++ b/NEWS
@@ -20,9 +20,11 @@ Bugs fixed:
 * Bug 639113 â?? Add static aggregation tests
 * Bug 639742 â?? Logger service unavailable in make check
 * Bug 640213 â?? Add tests for LinkedHashSet
+* Bug 627397 â?? Use better interface names
 
 API changes:
 * Rename the HasAvatar interface to AvatarOwner
+* Rename the HasPresence interface to PresenceOwner
 
 Overview of changes from libfolks 0.3.2 to libfolks 0.3.3
 =========================================================
diff --git a/backends/telepathy/lib/tpf-persona.vala b/backends/telepathy/lib/tpf-persona.vala
index 5f04159..4666842 100644
--- a/backends/telepathy/lib/tpf-persona.vala
+++ b/backends/telepathy/lib/tpf-persona.vala
@@ -32,7 +32,7 @@ public class Tpf.Persona : Folks.Persona,
     Favouritable,
     Groupable,
     AvatarOwner,
-    HasPresence,
+    PresenceOwner,
     IMable
 {
   private HashTable<string, bool> _groups;
@@ -57,14 +57,14 @@ public class Tpf.Persona : Folks.Persona,
   /**
    * The Persona's presence type.
    *
-   * See { link Folks.HasPresence.presence_type}.
+   * See { link Folks.PresenceOwner.presence_type}.
    */
   public Folks.PresenceType presence_type { get; private set; }
 
   /**
    * The Persona's presence message.
    *
-   * See { link Folks.HasPresence.presence_message}.
+   * See { link Folks.PresenceOwner.presence_message}.
    */
   public string presence_message { get; private set; }
 
diff --git a/folks/Makefile.am b/folks/Makefile.am
index f29a4bd..ddf0995 100644
--- a/folks/Makefile.am
+++ b/folks/Makefile.am
@@ -18,7 +18,7 @@ libfolks_la_SOURCES = \
 	favouritable.vala \
 	groupable.vala \
 	avatar-owner.vala \
-	has-presence.vala \
+	presence-owner.vala \
 	imable.vala \
 	individual.vala \
 	individual-aggregator.vala \
diff --git a/folks/individual.vala b/folks/individual.vala
index 01165d0..b298be5 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -67,7 +67,7 @@ public class Folks.Individual : Object,
     Favouritable,
     Groupable,
     AvatarOwner,
-    HasPresence,
+    PresenceOwner,
     IMable
 {
   private bool _is_favourite;
@@ -515,11 +515,11 @@ public class Folks.Individual : Object,
       /* Choose the most available presence from our personas */
       this._persona_list.foreach ((p) =>
         {
-          if (p is HasPresence)
+          if (p is PresenceOwner)
             {
-              var presence = (HasPresence) p;
+              unowned PresenceOwner presence = (PresenceOwner) p;
 
-              if (HasPresence.typecmp (presence.presence_type,
+              if (PresenceOwner.typecmp (presence.presence_type,
                   presence_type) > 0)
                 {
                   presence_type = presence.presence_type;
diff --git a/folks/has-presence.vala b/folks/presence-owner.vala
similarity index 90%
rename from folks/has-presence.vala
rename to folks/presence-owner.vala
index 5a3028a..7339302 100644
--- a/folks/has-presence.vala
+++ b/folks/presence-owner.vala
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Collabora Ltd.
+ * Copyright (C) 2010-2011 Collabora Ltd.
  *
  * This library is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -21,8 +21,8 @@
 using GLib;
 
 /**
- * The possible presence states an object implementing { link HasPresence} could
- * be in.
+ * The possible presence states an object implementing { link PresenceOwner}
+ * could be in.
  *
  * These closely follow the
  * [[http://telepathy.freedesktop.org/spec/Connection_Interface_Simple_Presence.html#Connection_Presence_Type|SimplePresence]]
@@ -76,7 +76,7 @@ public enum Folks.PresenceType {
  * { link PresenceType.UNSET} and their `presence_message` will be an empty
  * string.
  */
-public interface Folks.HasPresence : Object
+public interface Folks.PresenceOwner : Object
 {
   /**
    * The contact's presence type.
@@ -94,7 +94,7 @@ public interface Folks.HasPresence : Object
    * The contact's presence message.
    *
    * This is a short message written by the contact to add detail to their
-   * presence type ({ link Folks.HasPresence.presence_type}). If the contact
+   * presence type ({ link Folks.PresenceOwner.presence_type}). If the contact
    * hasn't set a message, it will be an empty string.
    */
   public abstract string presence_message { get; set; default = ""; }
@@ -142,15 +142,16 @@ public interface Folks.HasPresence : Object
    */
   public static int typecmp (PresenceType type_a, PresenceType type_b)
     {
-      return (HasPresence._type_availability (type_a) -
-          HasPresence._type_availability (type_b));
+      return (PresenceOwner._type_availability (type_a) -
+          PresenceOwner._type_availability (type_b));
     }
 
   /**
    * Whether the contact is online.
    *
    * This will be `true` if the contact's presence type is higher than
-   * { link PresenceType.OFFLINE}, as determined by { link HasPresence.typecmp}.
+   * { link PresenceType.OFFLINE}, as determined by
+   * { link PresenceOwner.typecmp}.
    *
    * @return `true` if the contact is online, `false` otherwise
    */
diff --git a/tests/telepathy/individual-properties.vala b/tests/telepathy/individual-properties.vala
index 30e4cb0..7f211f1 100644
--- a/tests/telepathy/individual-properties.vala
+++ b/tests/telepathy/individual-properties.vala
@@ -62,7 +62,7 @@ public class IndividualPropertiesTests : Folks.TestCase
               assert (i.alias == "Olivier");
               assert (i.presence_message == "");
               assert (i.presence_type == PresenceType.AWAY);
-              assert (((HasPresence) i).is_online () == true);
+              assert (((PresenceOwner) i).is_online () == true);
 
               /* Check groups */
               assert (i.groups.size () == 2);



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