[nautilus/wip/corey/selection-performance: 1/6] files-view: Drop selection batching code




commit 1fd87f60e8e1ae4b20bd20772e159a7fc62a1ec2
Author: Corey Berla <corey berla me>
Date:   Sat Oct 1 07:18:01 2022 -0700

    files-view: Drop selection batching code
    
    It's not used anymore. GtkListBase only emits a selection change
    when rubberbanding is finished.

 src/nautilus-files-view.c | 50 ++---------------------------------------------
 src/nautilus-files-view.h |  2 --
 2 files changed, 2 insertions(+), 50 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index f19fab712..72c0b3678 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -227,9 +227,6 @@ typedef struct
     gboolean show_hidden_files;
     gboolean ignore_hidden_file_preferences;
 
-    gboolean batching_selection_level;
-    gboolean selection_changed_while_batched;
-
     gboolean selection_was_removed;
 
     gboolean metadata_for_directory_as_file_pending;
@@ -8582,6 +8579,7 @@ nautilus_files_view_notify_selection_changed (NautilusFilesView *view)
     g_autolist (NautilusFile) selection = NULL;
 
     g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
+    g_warning ("selection changed");
 
     priv = nautilus_files_view_get_instance_private (view);
 
@@ -8599,21 +8597,7 @@ nautilus_files_view_notify_selection_changed (NautilusFilesView *view)
                           view);
     }
 
-    if (priv->batching_selection_level != 0)
-    {
-        priv->selection_changed_while_batched = TRUE;
-    }
-    else
-    {
-        /* Here is the work we do only when we're not
-         * batching selection changes. In other words, it's the slower
-         * stuff that we don't want to slow down selection techniques
-         * such as rubberband-selecting in icon view.
-         */
-
-        /* Schedule an update of menu item states to match selection */
-        schedule_update_context_menus (view);
-    }
+    schedule_update_context_menus (view);
 }
 
 static void
@@ -9105,36 +9089,6 @@ nautilus_files_view_trash_state_changed_callback (NautilusTrashMonitor *trash_mo
     schedule_update_context_menus (view);
 }
 
-void
-nautilus_files_view_start_batching_selection_changes (NautilusFilesView *view)
-{
-    NautilusFilesViewPrivate *priv;
-
-    g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
-    priv = nautilus_files_view_get_instance_private (view);
-
-    ++priv->batching_selection_level;
-    priv->selection_changed_while_batched = FALSE;
-}
-
-void
-nautilus_files_view_stop_batching_selection_changes (NautilusFilesView *view)
-{
-    NautilusFilesViewPrivate *priv;
-
-    g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
-    priv = nautilus_files_view_get_instance_private (view);
-    g_return_if_fail (priv->batching_selection_level > 0);
-
-    if (--priv->batching_selection_level == 0)
-    {
-        if (priv->selection_changed_while_batched)
-        {
-            nautilus_files_view_notify_selection_changed (view);
-        }
-    }
-}
-
 static void
 nautilus_files_view_get_property (GObject    *object,
                                   guint       prop_id,
diff --git a/src/nautilus-files-view.h b/src/nautilus-files-view.h
index e1882b7ba..f0731d045 100644
--- a/src/nautilus-files-view.h
+++ b/src/nautilus-files-view.h
@@ -252,8 +252,6 @@ void                nautilus_files_view_activate_files                   (Nautil
 void                nautilus_files_view_activate_file                    (NautilusFilesView *view,
                                                                           NautilusFile      *file,
                                                                           NautilusOpenFlags  flags);
-void                nautilus_files_view_start_batching_selection_changes (NautilusFilesView *view);
-void                nautilus_files_view_stop_batching_selection_changes  (NautilusFilesView *view);
 void                nautilus_files_view_notify_selection_changed         (NautilusFilesView *view);
 NautilusDirectory  *nautilus_files_view_get_model                        (NautilusFilesView *view);
 NautilusFile       *nautilus_files_view_get_directory_as_file            (NautilusFilesView *view);


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