diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-07-05 12:32:13 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-07-05 12:32:13 +0200 |
commit | 20d8caa264a50d0379611bd98c271a973c10cee1 (patch) | |
tree | 0bf2d7f7d8685b08cbb8a3b77c6bfef6a3908d22 | |
parent | ea5071e001f57d909ea51aceb7d3eec4cb895383 (diff) | |
download | telepathy-logger-20d8caa264a50d0379611bd98c271a973c10cee1.tar.gz |
_tpl_observer_register_channel can be static
-rw-r--r-- | telepathy-logger/observer-internal.h | 2 | ||||
-rw-r--r-- | telepathy-logger/observer.c | 42 |
2 files changed, 20 insertions, 24 deletions
diff --git a/telepathy-logger/observer-internal.h b/telepathy-logger/observer-internal.h index 95c597f..a1b80c8 100644 --- a/telepathy-logger/observer-internal.h +++ b/telepathy-logger/observer-internal.h @@ -63,8 +63,6 @@ GType _tpl_observer_get_type (void); TplObserver * _tpl_observer_new (void); -gboolean _tpl_observer_register_channel (TplObserver *self, - TplChannel *channel); gboolean _tpl_observer_unregister_channel (TplObserver *self, TplChannel *channel); void _tpl_observer_set_channel_factory (TplObserver *self, diff --git a/telepathy-logger/observer.c b/telepathy-logger/observer.c index 86e730d..6ed4602 100644 --- a/telepathy-logger/observer.c +++ b/telepathy-logger/observer.c @@ -207,6 +207,26 @@ error: g_error_free (err); } +static gboolean +_tpl_observer_register_channel (TplObserver *self, + TplChannel *channel) +{ + GHashTable *glob_map = tpl_observer_get_channel_map (self); + gchar *key; + + g_return_val_if_fail (TPL_IS_OBSERVER (self), FALSE); + g_return_val_if_fail (TPL_IS_CHANNEL (channel), FALSE); + g_return_val_if_fail (glob_map != NULL, FALSE); + + key = (char *) tp_proxy_get_object_path (G_OBJECT (channel)); + + DEBUG ("Registering channel %s", key); + + g_hash_table_insert (glob_map, key, g_object_ref (channel)); + g_object_notify (G_OBJECT (self), "registered-channels"); + + return TRUE; +} static void got_tpl_channel_text_ready_cb (GObject *obj, @@ -413,28 +433,6 @@ tpl_observer_get_channel_map (TplObserver *self) } -gboolean -_tpl_observer_register_channel (TplObserver *self, - TplChannel *channel) -{ - GHashTable *glob_map = tpl_observer_get_channel_map (self); - gchar *key; - - g_return_val_if_fail (TPL_IS_OBSERVER (self), FALSE); - g_return_val_if_fail (TPL_IS_CHANNEL (channel), FALSE); - g_return_val_if_fail (glob_map != NULL, FALSE); - - key = (char *) tp_proxy_get_object_path (G_OBJECT (channel)); - - DEBUG ("Registering channel %s", key); - - g_hash_table_insert (glob_map, key, g_object_ref (channel)); - g_object_notify (G_OBJECT (self), "registered-channels"); - - return TRUE; -} - - /** * _tpl_observer_unregister_channel: * @self: #TplObserver instance, cannot be %NULL. |