]> git.0d.be Git - empathy.git/commitdiff
Removed the manager from the view, relying only on the model
authorLaurent Contzen <lcontzen@gmail.com>
Sat, 4 Aug 2012 12:38:25 +0000 (14:38 +0200)
committerLaurent Contzen <lcontzen@gmail.com>
Mon, 6 Aug 2012 09:02:19 +0000 (11:02 +0200)
libempathy-gtk/empathy-roster-view.c
libempathy-gtk/empathy-roster-view.h
nautilus-sendto-plugin/empathy-nautilus-sendto.c
src/empathy-roster-window.c
tests/interactive/test-empathy-dual-roster-view.c
tests/interactive/test-empathy-roster-view.c

index 2b8154ecce07e82ade1ae972e72ab51b9b7f2ff1..06a4ebf94442edf0139f46db70fa0256af5759ac 100644 (file)
@@ -17,8 +17,7 @@ G_DEFINE_TYPE (EmpathyRosterView, empathy_roster_view, EGG_TYPE_LIST_BOX)
 
 enum
 {
-  PROP_MANAGER = 1,
-  PROP_MODEL,
+  PROP_MODEL = 1,
   PROP_SHOW_OFFLINE,
   PROP_SHOW_GROUPS,
   PROP_EMPTY,
@@ -40,8 +39,6 @@ static guint signals[LAST_SIGNAL];
 
 struct _EmpathyRosterViewPriv
 {
-  EmpathyIndividualManager *manager;
-
   /* FolksIndividual (borrowed) -> GHashTable (
    * (gchar * group_name) -> EmpathyRosterContact (borrowed))
    *
@@ -114,9 +111,6 @@ empathy_roster_view_get_property (GObject *object,
 
   switch (property_id)
     {
-      case PROP_MANAGER:
-        g_value_set_object (value, self->priv->manager);
-        break;
       case PROP_MODEL:
         g_value_set_object (value, self->priv->model);
         break;
@@ -145,10 +139,6 @@ empathy_roster_view_set_property (GObject *object,
 
   switch (property_id)
     {
-      case PROP_MANAGER:
-        g_assert (self->priv->manager == NULL); /* construct only */
-        self->priv->manager = g_value_dup_object (value);
-        break;
       case PROP_MODEL:
         g_assert (self->priv->model == NULL);
         self->priv->model = g_value_dup_object (value);
@@ -1076,7 +1066,6 @@ empathy_roster_view_constructed (GObject *object)
   if (chain_up != NULL)
     chain_up (object);
 
-  g_assert (EMPATHY_IS_INDIVIDUAL_MANAGER (self->priv->manager));
   g_assert (EMPATHY_IS_ROSTER_MODEL (self->priv->model));
 
   populate_view (self);
@@ -1113,7 +1102,6 @@ empathy_roster_view_dispose (GObject *object)
   stop_flashing (self);
 
   empathy_roster_view_set_live_search (self, NULL);
-  g_clear_object (&self->priv->manager);
   g_clear_object (&self->priv->model);
 
   if (chain_up != NULL)
@@ -1341,12 +1329,6 @@ empathy_roster_view_class_init (
 
   box_class->child_activated = empathy_roster_view_child_activated;
 
-  spec = g_param_spec_object ("manager", "Manager",
-      "EmpathyIndividualManager",
-      EMPATHY_TYPE_INDIVIDUAL_MANAGER,
-      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (oclass, PROP_MANAGER, spec);
-
   spec = g_param_spec_object ("model", "Model",
       "EmpathyRosterModel",
       EMPATHY_TYPE_ROSTER_MODEL,
@@ -1420,24 +1402,15 @@ empathy_roster_view_init (EmpathyRosterView *self)
 }
 
 GtkWidget *
-empathy_roster_view_new (EmpathyIndividualManager *manager,
-    EmpathyRosterModel *model)
+empathy_roster_view_new (EmpathyRosterModel *model)
 {
-  g_return_val_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (manager), NULL);
   g_return_val_if_fail (EMPATHY_IS_ROSTER_MODEL (model), NULL);
 
   return g_object_new (EMPATHY_TYPE_ROSTER_VIEW,
-      "manager", manager,
       "model", model,
       NULL);
 }
 
-EmpathyIndividualManager *
-empathy_roster_view_get_manager (EmpathyRosterView *self)
-{
-  return self->priv->manager;
-}
-
 void
 empathy_roster_view_show_offline (EmpathyRosterView *self,
     gboolean show)
index fd4f13ec1ded2706fcfdf9e5628189140cc5f9aa..6d5d760a3d353c4c064b16d1dd7db027619dc7aa 100644 (file)
@@ -5,7 +5,6 @@
 #include <libempathy-gtk/egg-list-box/egg-list-box.h>
 #include <libempathy-gtk/empathy-live-search.h>
 
-#include <libempathy/empathy-individual-manager.h>
 #include <libempathy-gtk/empathy-roster-model.h>
 
 G_BEGIN_DECLS
@@ -55,11 +54,7 @@ GType empathy_roster_view_get_type (void);
     EMPATHY_TYPE_ROSTER_VIEW, \
     EmpathyRosterViewClass))
 
-GtkWidget * empathy_roster_view_new (EmpathyIndividualManager *manager,
-    EmpathyRosterModel *model);
-
-EmpathyIndividualManager * empathy_roster_view_get_manager (
-    EmpathyRosterView *self);
+GtkWidget * empathy_roster_view_new (EmpathyRosterModel *model);
 
 void empathy_roster_view_show_offline (EmpathyRosterView *self,
     gboolean show);
index fcfc282154e1bb6ac15900a8bc64e60e38341f23..56c55f57af72fe86c1f01ffdf14b555a39278e96 100644 (file)
@@ -114,15 +114,15 @@ get_contacts_widget (NstPlugin *plugin)
   GtkWidget *roster_view, *box, *scrolled;
   EmpathyIndividualManager *mgr;
   EmpathyRosterModel *model;
-  
+
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
 
   mgr = empathy_individual_manager_dup_singleton ();
   model = EMPATHY_ROSTER_MODEL (empathy_roster_model_manager_new (mgr));
-  roster_view = empathy_roster_view_new (mgr, model);
+  roster_view = empathy_roster_view_new (model);
 
   g_object_unref (model);
-  
+
   scrolled = gtk_scrolled_window_new (NULL, NULL);
 
   g_object_unref (mgr);
index 2b7f98a2c1f071b2438094ed5594ca82b129885d..cc25c1995bc36c32e99e6fdd90e53c67e169a27e 100644 (file)
@@ -2233,8 +2233,7 @@ empathy_roster_window_init (EmpathyRosterWindow *self)
     }
 
   self->priv->view = EMPATHY_ROSTER_VIEW (
-      empathy_roster_view_new (self->priv->individual_manager,
-          model));
+      empathy_roster_view_new (model));
 
   g_object_unref (model);
 
index eae4f82c18222b2122e5031f1a96aaba3041c042..50903c01f5b56f050c8aa6fe857bbbe24badd954 100644 (file)
@@ -78,8 +78,7 @@ create_view_box (EmpathyRosterModel *model,
 
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
 
-  view = empathy_roster_view_new (empathy_individual_manager_dup_singleton (),
-      model);
+  view = empathy_roster_view_new (model);
 
   g_signal_connect (view, "individual-activated",
       G_CALLBACK (individual_activated_cb), NULL);
index 6ab56c8361977ce9419c3394cd76862fa695cf61..96137c395fa37ae38e929a3d141cb5b4dfc90690 100644 (file)
@@ -110,7 +110,7 @@ main (int argc,
   mgr = empathy_individual_manager_dup_singleton ();
 
   model = EMPATHY_ROSTER_MODEL (empathy_roster_model_manager_new (mgr));
-  view = empathy_roster_view_new (mgr, model);
+  view = empathy_roster_view_new (model);
 
   g_object_unref (model);
   g_signal_connect (view, "individual-activated",