[file-roller/wip/jtojnar/engrampa-backports: 16/24] gtk-utils: Remove _gtk_count_selected




commit 9c69d57d7a340f69191e6db8474f8d5e9c40aeb1
Author: rbuj <robert buj gmail com>
Date:   Sat Feb 29 15:39:01 2020 +0100

    gtk-utils: Remove _gtk_count_selected
    
    Cherry picked from 
https://github.com/mate-desktop/engrampa/commit/fbcbacb489100dbb876de3b2f5226f87e8f10092

 src/fr-window.c |  2 +-
 src/gtk-utils.c | 24 ------------------------
 src/gtk-utils.h |  1 -
 3 files changed, 1 insertion(+), 26 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index b202d185..ad5f684e 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -3520,7 +3520,7 @@ fr_window_get_file_list (FrWindow *window)
 int
 fr_window_get_n_selected_files (FrWindow *window)
 {
-       return _gtk_tree_selection_count_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW 
(window->priv->list_view)));
+       return gtk_tree_selection_count_selected_rows (gtk_tree_view_get_selection (GTK_TREE_VIEW 
(window->priv->list_view)));
 }
 
 
diff --git a/src/gtk-utils.c b/src/gtk-utils.c
index dbe392a3..c09f164a 100644
--- a/src/gtk-utils.c
+++ b/src/gtk-utils.c
@@ -26,30 +26,6 @@
 #define LOAD_BUFFER_SIZE 65536
 
 
-static void
-count_selected (GtkTreeModel *model,
-               GtkTreePath  *path,
-               GtkTreeIter  *iter,
-               gpointer      data)
-{
-       int *n = data;
-       *n = *n + 1;
-}
-
-
-int
-_gtk_tree_selection_count_selected (GtkTreeSelection *selection)
-{
-       int n = 0;
-
-       if (selection == NULL)
-               return 0;
-
-       gtk_tree_selection_selected_foreach (selection, count_selected, &n);
-       return n;
-}
-
-
 GtkWidget *
 _gtk_message_dialog_new (GtkWindow      *parent,
                         GtkDialogFlags  flags,
diff --git a/src/gtk-utils.h b/src/gtk-utils.h
index 837abd63..3c5c897a 100644
--- a/src/gtk-utils.h
+++ b/src/gtk-utils.h
@@ -40,7 +40,6 @@ typedef struct {
        const char *accelerator;
 } FrAccelerator;
 
-int           _gtk_tree_selection_count_selected   (GtkTreeSelection *selection);
 GtkWidget *   _gtk_message_dialog_new              (GtkWindow        *parent,
                                                    GtkDialogFlags    flags,
                                                    const char       *message,


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