aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGabriel Millaire <millaire.gabriel@gmail.com>2009-05-12 10:15:14 +0800
committerGabriel Millaire <millaire.gabriel@gmail.com>2009-05-22 23:15:42 +0800
commit740f230888350114708d51067e624b31880cfdb2 (patch)
tree8a719a3c8c6e8a26b6395cb5efd36d29044fdaf5 /libempathy
parent7b1c449738cd5800d54335eb5512a3b8231b1e12 (diff)
downloadgsoc2013-empathy-740f230888350114708d51067e624b31880cfdb2.tar
gsoc2013-empathy-740f230888350114708d51067e624b31880cfdb2.tar.gz
gsoc2013-empathy-740f230888350114708d51067e624b31880cfdb2.tar.bz2
gsoc2013-empathy-740f230888350114708d51067e624b31880cfdb2.tar.lz
gsoc2013-empathy-740f230888350114708d51067e624b31880cfdb2.tar.xz
gsoc2013-empathy-740f230888350114708d51067e624b31880cfdb2.tar.zst
gsoc2013-empathy-740f230888350114708d51067e624b31880cfdb2.zip
Implement error signal
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-roomlist.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/libempathy/empathy-tp-roomlist.c b/libempathy/empathy-tp-roomlist.c
index 417a287d3..104b8a347 100644
--- a/libempathy/empathy-tp-roomlist.c
+++ b/libempathy/empathy-tp-roomlist.c
@@ -48,6 +48,7 @@ typedef struct {
enum {
NEW_ROOM,
DESTROY,
+ ERROR,
LAST_SIGNAL
};
@@ -239,22 +240,24 @@ tp_roomlist_invalidated_cb (TpChannel *channel,
static void
call_list_rooms_cb (TpChannel *proxy,
const GError *error,
- gpointer user_data,
+ gpointer list,
GObject *weak_object)
{
if (error != NULL) {
DEBUG ("Error listing rooms: %s", error->message);
+ g_signal_emit_by_name (list, "error::start", error);
}
}
static void
stop_listing_cb (TpChannel *proxy,
const GError *error,
- gpointer user_data,
+ gpointer list,
GObject *weak_object)
{
if (error != NULL) {
DEBUG ("Error on stop listing: %s", error->message);
+ g_signal_emit_by_name (list, "error::stop", error);
}
}
@@ -452,6 +455,16 @@ empathy_tp_roomlist_class_init (EmpathyTpRoomlistClass *klass)
G_TYPE_NONE,
0);
+ signals[ERROR] =
+ g_signal_new ("error",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE,
+ 1, G_TYPE_POINTER);
+
g_type_class_add_private (object_class, sizeof (EmpathyTpRoomlistPriv));
}
@@ -506,7 +519,7 @@ empathy_tp_roomlist_start (EmpathyTpRoomlist *list)
g_return_if_fail (EMPATHY_IS_TP_ROOMLIST (list));
if (priv->channel != NULL) {
tp_cli_channel_type_room_list_call_list_rooms (priv->channel, -1,
- call_list_rooms_cb, NULL, NULL, NULL);
+ call_list_rooms_cb, list, NULL, NULL);
} else {
priv->start_requested = TRUE;
}
@@ -521,6 +534,6 @@ empathy_tp_roomlist_stop (EmpathyTpRoomlist *list)
g_return_if_fail (TP_IS_CHANNEL (priv->channel));
tp_cli_channel_type_room_list_call_stop_listing (priv->channel, -1,
- stop_listing_cb, NULL, NULL, NULL);
+ stop_listing_cb, list, NULL, NULL);
}