[easytag/easytag-2-2] Fix Ctrl-clicking to toggle file selection



commit ca1e78be6d58d15e89c5fa0f69352df717d3d713
Author: David King <amigadave amigadave com>
Date:   Fri Dec 26 22:36:39 2014 +0000

    Fix Ctrl-clicking to toggle file selection
    
    In the selection changed handler, only change the current file shown in
    the file and tag areas if it is selected. When unselecting, do not
    update the current file.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741980

 src/browser.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/browser.c b/src/browser.c
index aee4c34..68ca926 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -1006,6 +1006,7 @@ Browser_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
      */
     if (n_selected == 0)
     {
+        /* TODO: Clear the tag area and file area. */
         return;
     }
 
@@ -1020,9 +1021,14 @@ Browser_List_Row_Selected (GtkTreeSelection *selection, gpointer data)
     if (gtk_tree_model_get_iter (GTK_TREE_MODEL (fileListModel), &cursor_iter,
                                  cursor_path))
     {
-        gtk_tree_model_get (GTK_TREE_MODEL (fileListModel), &cursor_iter,
-                            LIST_FILE_POINTER, &cursor_et_file, -1);
-        Action_Select_Nth_File_By_Etfile (cursor_et_file);
+        if (gtk_tree_selection_iter_is_selected (selection, &cursor_iter))
+        {
+            gtk_tree_model_get (GTK_TREE_MODEL (fileListModel), &cursor_iter,
+                                LIST_FILE_POINTER, &cursor_et_file, -1);
+            Action_Select_Nth_File_By_Etfile (cursor_et_file);
+        }
+        /* TODO: Clear the tag/file area if the cursor row was unselected, such
+         * as by inverting the selection or Ctrl-clicking. */
     }
     else
     {


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