[empathy] empathy-roster-model, empathy-roster-model-manager: Now deals with groups-changed signal empathy-ros
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] empathy-roster-model, empathy-roster-model-manager: Now deals with groups-changed signal empathy-ros
- Date: Mon, 23 Jul 2012 14:11:40 +0000 (UTC)
commit 5e102f002d353aceb687f92499635b86a0ba2d9b
Author: Laurent Contzen <lcontzen gmail com>
Date: Wed Jul 4 14:59:48 2012 +0200
empathy-roster-model, empathy-roster-model-manager: Now deals with groups-changed signal empathy-roster-view.c: now uses roster-model's groups-changed signal
https://bugzilla.gnome.org/show_bug.cgi?id=680302
libempathy-gtk/empathy-roster-model-manager.c | 15 +++++++++++++++
libempathy-gtk/empathy-roster-model.c | 20 ++++++++++++++++++++
libempathy-gtk/empathy-roster-model.h | 5 +++++
libempathy-gtk/empathy-roster-view.c | 6 +++---
4 files changed, 43 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-roster-model-manager.c b/libempathy-gtk/empathy-roster-model-manager.c
index ed414aa..2684d27 100644
--- a/libempathy-gtk/empathy-roster-model-manager.c
+++ b/libempathy-gtk/empathy-roster-model-manager.c
@@ -78,6 +78,19 @@ members_changed_cb (EmpathyIndividualManager *manager,
}
static void
+groups_changed_cb (EmpathyIndividualManager *manager,
+ FolksIndividual *individual,
+ const gchar *group,
+ gboolean is_member,
+ EmpathyRosterModelManager *self)
+{
+ empathy_roster_model_fire_groups_changed (EMPATHY_ROSTER_MODEL (self),
+ individual,
+ group,
+ is_member);
+}
+
+static void
empathy_roster_model_manager_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -130,6 +143,8 @@ empathy_roster_model_manager_constructed (GObject *object)
tp_g_signal_connect_object (self->priv->manager, "members-changed",
G_CALLBACK (members_changed_cb), self, 0);
+ tp_g_signal_connect_object (self->priv->manager, "groups-changed",
+ G_CALLBACK (groups_changed_cb), self, 0);
}
static void
diff --git a/libempathy-gtk/empathy-roster-model.c b/libempathy-gtk/empathy-roster-model.c
index ce86e58..eaceca5 100644
--- a/libempathy-gtk/empathy-roster-model.c
+++ b/libempathy-gtk/empathy-roster-model.c
@@ -27,6 +27,7 @@ enum
{
SIG_INDIVIDUAL_ADDED,
SIG_INDIVIDUAL_REMOVED,
+ SIG_GROUPS_CHANGED,
LAST_SIGNAL
};
@@ -50,6 +51,16 @@ empathy_roster_model_default_init (EmpathyRosterModelInterface *iface)
0, NULL, NULL, NULL,
G_TYPE_NONE, 1,
FOLKS_TYPE_INDIVIDUAL);
+
+ signals[SIG_GROUPS_CHANGED] =
+ g_signal_new ("groups-changed",
+ EMPATHY_TYPE_ROSTER_MODEL,
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 3,
+ FOLKS_TYPE_INDIVIDUAL,
+ G_TYPE_STRING,
+ G_TYPE_BOOLEAN);
}
/***** Restricted *****/
@@ -68,6 +79,15 @@ empathy_roster_model_fire_individual_removed (EmpathyRosterModel *self,
g_signal_emit (self, signals[SIG_INDIVIDUAL_REMOVED], 0, individual);
}
+void
+empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self,
+ FolksIndividual *individual,
+ const gchar *group,
+ gboolean is_member)
+{
+ g_signal_emit (self, signals[SIG_GROUPS_CHANGED], 0, individual, group, is_member);
+}
+
/***** Public *****/
GList *
diff --git a/libempathy-gtk/empathy-roster-model.h b/libempathy-gtk/empathy-roster-model.h
index e6c3828..59db96f 100644
--- a/libempathy-gtk/empathy-roster-model.h
+++ b/libempathy-gtk/empathy-roster-model.h
@@ -63,6 +63,11 @@ void empathy_roster_model_fire_individual_added (EmpathyRosterModel *self,
void empathy_roster_model_fire_individual_removed (EmpathyRosterModel *self,
FolksIndividual *individual);
+void empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self,
+ FolksIndividual *individual,
+ const gchar *group,
+ gboolean is_member);
+
/* Public API */
GList * empathy_roster_model_get_individuals (EmpathyRosterModel *self);
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 90d7296..b07a4b2 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -1040,9 +1040,9 @@ update_top_contacts (EmpathyRosterView *self)
}
static void
-groups_changed_cb (EmpathyIndividualManager *manager,
+groups_changed_cb (EmpathyRosterModel *model,
FolksIndividual *individual,
- gchar *group,
+ const gchar *group,
gboolean is_member,
EmpathyRosterView *self)
{
@@ -1118,7 +1118,7 @@ empathy_roster_view_constructed (GObject *object)
G_CALLBACK (individual_added_cb), self, 0);
tp_g_signal_connect_object (self->priv->model, "individual-removed",
G_CALLBACK (individual_removed_cb), self, 0);
- tp_g_signal_connect_object (self->priv->manager, "groups-changed",
+ tp_g_signal_connect_object (self->priv->model, "groups-changed",
G_CALLBACK (groups_changed_cb), self, 0);
tp_g_signal_connect_object (self->priv->manager, "notify::top-individuals",
G_CALLBACK (top_individuals_changed_cb), self, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]