[Telepathy-commits] [telepathy-gabble/master] merge ActivityGadgetAvailable and BuddyGadgetAvailable D-Bus properties
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Fri Sep 26 08:49:51 PDT 2008
---
extensions/OLPC_Gadget.xml | 10 ++--------
src/conn-olpc.c | 9 +++------
src/connection.c | 3 +--
tests/twisted/olpc/gadget-publish.py | 6 ++----
4 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/extensions/OLPC_Gadget.xml b/extensions/OLPC_Gadget.xml
index e7a1fc9..bcdbd01 100644
--- a/extensions/OLPC_Gadget.xml
+++ b/extensions/OLPC_Gadget.xml
@@ -166,15 +166,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</p>
</tp:docstring>
</signal>
- <property name="ActivityGadgetAvailable" type="b" access="read">
+ <property name="GadgetAvailable" type="b" access="read">
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>TRUE if the Gadget component managing activities was found on this connection.</p>
- </tp:docstring>
- </property>
-
- <property name="BuddyGadgetAvailable" type="b" access="read">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>TRUE if the Gadget component managing buddies was found on this connection.</p>
+ <p>TRUE if the Gadget component was found on this connection.</p>
</tp:docstring>
</property>
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index 8118a55..751fef8 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -4456,13 +4456,10 @@ conn_olpc_gadget_propeties_getter (GObject *object,
{
GabbleConnection *conn = GABBLE_CONNECTION (object);
- if (!tp_strdiff (g_quark_to_string (name), "ActivityGadgetAvailable"))
+ if (!tp_strdiff (g_quark_to_string (name), "GadgetAvailable"))
{
- g_value_set_boolean (value, check_gadget_activity (conn, NULL));
- }
- else if (!tp_strdiff (g_quark_to_string (name), "BuddyGadgetAvailable"))
- {
- g_value_set_boolean (value, check_gadget_buddy (conn, NULL));
+ g_value_set_boolean (value, check_gadget_activity (conn, NULL) ||
+ check_gadget_buddy (conn, NULL));
}
else
{
diff --git a/src/connection.c b/src/connection.c
index 6dfd0d6..d293c29 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -509,8 +509,7 @@ gabble_connection_class_init (GabbleConnectionClass *gabble_connection_class)
GABBLE_IFACE_OLPC_GADGET,
NULL };
static TpDBusPropertiesMixinPropImpl olpc_gadget_props[] = {
- { "ActivityGadgetAvailable", NULL, NULL },
- { "BuddyGadgetAvailable", NULL, NULL },
+ { "GadgetAvailable", NULL, NULL },
{ NULL }
};
static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
diff --git a/tests/twisted/olpc/gadget-publish.py b/tests/twisted/olpc/gadget-publish.py
index a4586ea..2e336f8 100644
--- a/tests/twisted/olpc/gadget-publish.py
+++ b/tests/twisted/olpc/gadget-publish.py
@@ -41,8 +41,7 @@ def test(q, bus, conn, stream):
props = conn.GetAll(
'org.laptop.Telepathy.Gadget',
dbus_interface='org.freedesktop.DBus.Properties')
- assert props['ActivityGadgetAvailable'] == False
- assert props['BuddyGadgetAvailable'] == False
+ assert props['GadgetAvailable'] == False
announce_gadget(q, stream, disco_event.stanza)
@@ -51,8 +50,7 @@ def test(q, bus, conn, stream):
props = conn.GetAll(
'org.laptop.Telepathy.Gadget',
dbus_interface='org.freedesktop.DBus.Properties')
- assert props['ActivityGadgetAvailable'] == True
- assert props['BuddyGadgetAvailable'] == True
+ assert props['GadgetAvailable'] == True
gadget_iface = dbus.Interface(conn, 'org.laptop.Telepathy.Gadget')
--
1.5.6.5
More information about the Telepathy-commits
mailing list