[gnome-documents] view: remove now unused code



commit f6ed3887ac0d31b774c9e856f5602f9d187486c3
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Feb 27 19:38:17 2012 -0500

    view: remove now unused code
    
    Since we track selections in the model, this is no longer needed.

 src/lib/gd-main-icon-view.c    |   33 -------------------------
 src/lib/gd-main-list-view.c    |   51 ----------------------------------------
 src/lib/gd-main-view-generic.c |   49 --------------------------------------
 src/lib/gd-main-view-generic.h |   14 -----------
 4 files changed, 0 insertions(+), 147 deletions(-)
---
diff --git a/src/lib/gd-main-icon-view.c b/src/lib/gd-main-icon-view.c
index 7e88ba7..ad7864b 100644
--- a/src/lib/gd-main-icon-view.c
+++ b/src/lib/gd-main-icon-view.c
@@ -120,14 +120,6 @@ gd_main_icon_view_init (GdMainIconView *self)
   self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GD_TYPE_MAIN_ICON_VIEW, GdMainIconViewPrivate);
 }
 
-static GList *
-gd_main_icon_view_get_selection (GdMainViewGeneric *mv)
-{
-  GtkIconView *iv = GTK_ICON_VIEW (mv);
-
-  return gtk_icon_view_get_selected_items (iv);
-}
-
 static GtkTreePath *
 gd_main_icon_view_get_path_at_pos (GdMainViewGeneric *mv,
                                    gint x,
@@ -155,27 +147,6 @@ gd_main_icon_view_scroll_to_path (GdMainViewGeneric *mv,
   gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (mv), path, TRUE, 0.5, 0.5);
 }
 
-static gboolean
-gd_main_icon_view_path_is_selected (GdMainViewGeneric *mv,
-                                    GtkTreePath *path)
-{
-  return gtk_icon_view_path_is_selected (GTK_ICON_VIEW (mv), path);
-}
-
-static void
-gd_main_icon_view_select_path (GdMainViewGeneric *mv,
-                               GtkTreePath *path)
-{
-  gtk_icon_view_select_path (GTK_ICON_VIEW (mv), path);
-}
-
-static void
-gd_main_icon_view_unselect_path (GdMainViewGeneric *mv,
-                                 GtkTreePath *path)
-{
-  gtk_icon_view_unselect_path (GTK_ICON_VIEW (mv), path);
-}
-
 static void
 gd_main_icon_view_set_model (GdMainViewGeneric *mv,
                              GtkTreeModel *model)
@@ -187,13 +158,9 @@ static void
 gd_main_view_generic_iface_init (GdMainViewGenericIface *iface)
 {
   iface->set_model = gd_main_icon_view_set_model;
-  iface->get_selection = gd_main_icon_view_get_selection;
   iface->get_path_at_pos = gd_main_icon_view_get_path_at_pos;
   iface->scroll_to_path = gd_main_icon_view_scroll_to_path;
   iface->set_selection_mode = gd_main_icon_view_set_selection_mode;
-  iface->path_is_selected = gd_main_icon_view_path_is_selected;
-  iface->select_path = gd_main_icon_view_select_path;
-  iface->unselect_path = gd_main_icon_view_unselect_path;
 }
 
 GtkWidget *
diff --git a/src/lib/gd-main-list-view.c b/src/lib/gd-main-list-view.c
index 14aa4f0..5a93acd 100644
--- a/src/lib/gd-main-list-view.c
+++ b/src/lib/gd-main-list-view.c
@@ -37,14 +37,6 @@ G_DEFINE_TYPE_WITH_CODE (GdMainListView, gd_main_list_view, GTK_TYPE_TREE_VIEW,
                                                 gd_main_view_generic_iface_init))
 
 static void
-on_tree_selection_changed (GtkTreeSelection *selection,
-                           gpointer user_data)
-{
-  GdMainListView *self = user_data;
-  g_signal_emit_by_name (self, "view-selection-changed");
-}
-
-static void
 gd_main_list_view_constructed (GObject *obj)
 {
   GdMainListView *self = GD_MAIN_LIST_VIEW (obj);
@@ -115,15 +107,6 @@ gd_main_list_view_init (GdMainListView *self)
   self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GD_TYPE_MAIN_LIST_VIEW, GdMainListViewPrivate);
 }
 
-static GList *
-gd_main_list_view_get_selection (GdMainViewGeneric *mv)
-{
-  GtkTreeSelection *selection;
-
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (mv));
-  return gtk_tree_selection_get_selected_rows (selection, NULL);
-}
-
 static GtkTreePath *
 gd_main_list_view_get_path_at_pos (GdMainViewGeneric *mv,
                                    gint x,
@@ -156,36 +139,6 @@ gd_main_list_view_scroll_to_path (GdMainViewGeneric *mv,
   gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (mv), path, NULL, TRUE, 0.5, 0.5);
 }
 
-static gboolean
-gd_main_list_view_path_is_selected (GdMainViewGeneric *mv,
-                                    GtkTreePath *path)
-{
-  GtkTreeSelection *selection;
-
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (mv));
-  return gtk_tree_selection_path_is_selected (selection, path);
-}
-
-static void
-gd_main_list_view_select_path (GdMainViewGeneric *mv,
-                               GtkTreePath *path)
-{
-  GtkTreeSelection *selection;
-
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (mv));
-  gtk_tree_selection_select_path (selection, path);
-}
-
-static void
-gd_main_list_view_unselect_path (GdMainViewGeneric *mv,
-                                 GtkTreePath *path)
-{
-  GtkTreeSelection *selection;
-
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (mv));
-  gtk_tree_selection_unselect_path (selection, path);
-}
-
 static void
 gd_main_list_view_set_model (GdMainViewGeneric *mv,
                              GtkTreeModel *model)
@@ -197,13 +150,9 @@ static void
 gd_main_view_generic_iface_init (GdMainViewGenericIface *iface)
 {
   iface->set_model = gd_main_list_view_set_model;
-  iface->get_selection = gd_main_list_view_get_selection;
   iface->get_path_at_pos = gd_main_list_view_get_path_at_pos;
   iface->scroll_to_path = gd_main_list_view_scroll_to_path;
   iface->set_selection_mode = gd_main_list_view_set_selection_mode;
-  iface->select_path = gd_main_list_view_select_path;
-  iface->unselect_path = gd_main_list_view_unselect_path;
-  iface->path_is_selected = gd_main_list_view_path_is_selected;
 }
 
 void
diff --git a/src/lib/gd-main-view-generic.c b/src/lib/gd-main-view-generic.c
index 7496a0e..f3d1600 100644
--- a/src/lib/gd-main-view-generic.c
+++ b/src/lib/gd-main-view-generic.c
@@ -60,22 +60,6 @@ gd_main_view_generic_set_model (GdMainViewGeneric *self,
   (* iface->set_model) (self, model);
 }
 
-/**
- * gd_main_view_generic_get_selection:
- * @self:
- *
- * Returns: (element-type GtkTreePath) (transfer full):
- */
-GList *
-gd_main_view_generic_get_selection (GdMainViewGeneric *self)
-{
-  GdMainViewGenericInterface *iface;
-
-  iface = GD_MAIN_VIEW_GENERIC_GET_IFACE (self);
-
-  return (* iface->get_selection) (self);
-}
-
 GtkTreePath *
 gd_main_view_generic_get_path_at_pos (GdMainViewGeneric *self,
                                       gint x,
@@ -109,36 +93,3 @@ gd_main_view_generic_scroll_to_path (GdMainViewGeneric *self,
 
   (* iface->scroll_to_path) (self, path);
 }
-
-gboolean
-gd_main_view_generic_path_is_selected (GdMainViewGeneric *self,
-                                       GtkTreePath *path)
-{
-  GdMainViewGenericInterface *iface;
-
-  iface = GD_MAIN_VIEW_GENERIC_GET_IFACE (self);
-
-  return (* iface->path_is_selected) (self, path);
-}
-
-void
-gd_main_view_generic_select_path (GdMainViewGeneric *self,
-                                  GtkTreePath *path)
-{
-  GdMainViewGenericInterface *iface;
-
-  iface = GD_MAIN_VIEW_GENERIC_GET_IFACE (self);
-
-  (* iface->select_path) (self, path);
-}
-
-void
-gd_main_view_generic_unselect_path (GdMainViewGeneric *self,
-                                    GtkTreePath *path)
-{
-  GdMainViewGenericInterface *iface;
-
-  iface = GD_MAIN_VIEW_GENERIC_GET_IFACE (self);
-
-  (* iface->unselect_path) (self, path);
-}
diff --git a/src/lib/gd-main-view-generic.h b/src/lib/gd-main-view-generic.h
index 89c5e3a..f99a950 100644
--- a/src/lib/gd-main-view-generic.h
+++ b/src/lib/gd-main-view-generic.h
@@ -71,13 +71,6 @@ struct _GdMainViewGenericIface
                                           GtkTreePath       *path);
   void          (* set_selection_mode)   (GdMainViewGeneric *view,
                                           gboolean           selection_mode);
-  GList *       (* get_selection)        (GdMainViewGeneric *view);
-  gboolean      (* path_is_selected)     (GdMainViewGeneric *view,
-                                          GtkTreePath       *path);
-  void          (* select_path)          (GdMainViewGeneric *view,
-                                          GtkTreePath       *path);
-  void          (* unselect_path)        (GdMainViewGeneric *view,
-                                          GtkTreePath       *path);
 };
 
 GType gd_main_view_generic_get_type (void) G_GNUC_CONST;
@@ -92,13 +85,6 @@ void gd_main_view_generic_set_selection_mode (GdMainViewGeneric *self,
 GtkTreePath * gd_main_view_generic_get_path_at_pos (GdMainViewGeneric *self,
                                                     gint x,
                                                     gint y);
-GList * gd_main_view_generic_get_selection (GdMainViewGeneric *self);
-gboolean gd_main_view_generic_path_is_selected (GdMainViewGeneric *self,
-                                                GtkTreePath *path);
-void gd_main_view_generic_select_path (GdMainViewGeneric *self,
-                                       GtkTreePath *path);
-void gd_main_view_generic_unselect_path (GdMainViewGeneric *self,
-                                         GtkTreePath *path);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]