[gnome-photos/gnome-3-20] view-container: Restrict app.select-all to the current mode



commit a40d015d3a043f17fdfb574e08925000cd607f05
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Aug 24 18:18:00 2016 +0200

    view-container: Restrict app.select-all to the current mode
    
    Otherwise, app.select-all will select every item from every mode. This
    means that:
     - the selection count will be wrong
     - the status of the buttons selection toolbar won't match with the
       visible selection
     - we might delete or share something that the user didn't intend to

 src/photos-view-container.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-view-container.c b/src/photos-view-container.c
index d9d8133..d82a374 100644
--- a/src/photos-view-container.c
+++ b/src/photos-view-container.c
@@ -166,6 +166,12 @@ photos_view_container_query_status_changed (PhotosViewContainer *self, gboolean
 static void
 photos_view_container_select_all (PhotosViewContainer *self)
 {
+  PhotosWindowMode mode;
+
+  mode = photos_mode_controller_get_window_mode (self->mode_cntrlr);
+  if (self->mode != mode)
+    return;
+
   photos_selection_controller_set_selection_mode (self->sel_cntrlr, TRUE);
   gd_main_view_select_all (self->view);
 }


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