summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Staudinger <robsta@linux.intel.com>2012-02-13 13:47:59 +0100
committerRob Staudinger <robsta@linux.intel.com>2012-02-13 13:47:59 +0100
commitf5ce5e899975dd9dfcefaaaac7b916e20248608b (patch)
tree568f7b1b778f56296d63292d8047a88ef2a246ef
parent53aa45a811f522002c85d17f8e45a5b452b296b4 (diff)
Client: Add "tp-status" property
Add a GObject property for being able to access the client's ytstenut status property. The new roster will need this.
-rw-r--r--ytstenut/yts-client-internal.h6
-rw-r--r--ytstenut/yts-client.c26
2 files changed, 25 insertions, 7 deletions
diff --git a/ytstenut/yts-client-internal.h b/ytstenut/yts-client-internal.h
index b859d55..de13ccf 100644
--- a/ytstenut/yts-client-internal.h
+++ b/ytstenut/yts-client-internal.h
@@ -26,10 +26,10 @@
#include <ytstenut/yts-error.h>
#include <ytstenut/yts-metadata.h>
-TpConnection *
-yts_client_get_connection (YtsClient *client);
+TpConnection *const
+yts_client_get_tp_connection (YtsClient *client);
-TpYtsStatus *
+TpYtsStatus *const
yts_client_get_tp_status (YtsClient *client);
YtsError
diff --git a/ytstenut/yts-client.c b/ytstenut/yts-client.c
index 76c07d4..79aa44b 100644
--- a/ytstenut/yts-client.c
+++ b/ytstenut/yts-client.c
@@ -145,7 +145,8 @@ enum
PROP_SERVICE_ID,
PROP_PROTOCOL,
- PROP_TP_ACCOUNT
+ PROP_TP_ACCOUNT,
+ PROP_TP_STATUS
};
static guint signals[N_SIGNALS] = {0};
@@ -1223,6 +1224,9 @@ yts_client_get_property (GObject *object,
case PROP_TP_ACCOUNT:
g_value_set_object (value, priv->tp_account);
break;
+ case PROP_TP_STATUS:
+ g_value_set_object (value, priv->tp_status);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -1433,6 +1437,19 @@ yts_client_class_init (YtsClientClass *klass)
g_object_class_install_property (object_class, PROP_TP_ACCOUNT, pspec);
/**
+ * YtsClient:tp-status:
+ *
+ * Telepathies #TpYtsStatus object used by this instance.
+ * <note>There is no API guarantee for this and other fields that expose telepathy.</note>
+ *
+ * Since: 0.4
+ */
+ pspec = g_param_spec_object ("tp-status", "", "",
+ TP_TYPE_YTS_STATUS,
+ G_PARAM_READABLE);
+ g_object_class_install_property (object_class, PROP_TP_STATUS, pspec);
+
+ /**
* YtsClient::authenticated:
* @self: object which emitted the signal.
*
@@ -2240,6 +2257,7 @@ yts_client_yts_status_cb (GObject *obj,
g_message ("Processing tp_status");
priv->tp_status = tp_status;
+ g_object_notify (G_OBJECT (self), "tp-status");
tp_g_signal_connect_object (tp_status, "service-added",
G_CALLBACK (yts_client_service_added_cb),
@@ -2694,8 +2712,8 @@ yts_client_get_service_id (YtsClient const *self)
return priv->service_id;
}
-TpConnection *
-yts_client_get_connection (YtsClient *self)
+TpConnection *const
+yts_client_get_tp_connection (YtsClient *self)
{
YtsClientPrivate *priv = GET_PRIVATE (self);
@@ -2704,7 +2722,7 @@ yts_client_get_connection (YtsClient *self)
return priv->tp_conn;
}
-TpYtsStatus *
+TpYtsStatus *const
yts_client_get_tp_status (YtsClient *self)
{
YtsClientPrivate *priv = GET_PRIVATE (self);