summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Crequy <alban.crequy@collabora.co.uk>2010-12-15 15:01:50 +0000
committerAlban Crequy <alban.crequy@collabora.co.uk>2010-12-15 15:01:50 +0000
commita11d2a44aea653b4ad25e6e67b88dbbdbec764ad (patch)
treee4210eb3aed7d8cf8486523daac02b5c71ff3fcf
parent0f339e8df2c0b2118791b7dcfeb7f1b5d0ba86e3 (diff)
Allow ContactView to be reused for different libfolks Individuals
-rw-r--r--liszt/contact-view.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/liszt/contact-view.c b/liszt/contact-view.c
index a0521696c..95dde0d23 100644
--- a/liszt/contact-view.c
+++ b/liszt/contact-view.c
@@ -28,6 +28,7 @@ enum
struct _LolContactViewPrivate
{
FolksIndividual *individual;
+ gulong individual_signal_handler;
ClutterActor *presence_texture;
ClutterActor *name_text;
@@ -121,13 +122,17 @@ lol_contact_view_set_avatar (LolContactView *self,
gchar *tmp;
if (file == NULL)
- return;
+ {
+ clutter_actor_hide (priv->avatar_texture);
+ return;
+ }
tmp = g_file_get_path (file);
clutter_texture_set_from_file (
CLUTTER_TEXTURE (priv->avatar_texture),
tmp, NULL);
+ clutter_actor_show (priv->avatar_texture);
g_free (tmp);
}
@@ -277,13 +282,16 @@ lol_contact_view_set_property (GObject *object,
{
case PROP_INDIVIDUAL:
{
- if (priv->individual == NULL)
+ if (priv->individual != NULL)
{
- priv->individual = g_value_dup_object (value);
- lol_contact_view_update_individual (self);
- g_signal_connect (priv->individual, "notify",
- G_CALLBACK (individual_notify_cb), self);
+ g_signal_handler_disconnect (priv->individual,
+ priv->individual_signal_handler);
+ g_object_unref (priv->individual);
}
+ priv->individual = g_value_dup_object (value);
+ lol_contact_view_update_individual (self);
+ priv->individual_signal_handler = g_signal_connect (priv->individual,
+ "notify", G_CALLBACK (individual_notify_cb), self);
}
break;
default:
@@ -488,6 +496,8 @@ lol_contact_view_dispose (GObject *obj)
if (self->priv->individual != NULL)
{
+ g_signal_handler_disconnect (self->priv->individual,
+ self->priv->individual_signal_handler);
g_object_unref (self->priv->individual);
self->priv->individual = NULL;
}