Open tree node if expanded and mounted (bug #9603).
authorNick Schermer <nick@xfce.org>
Sun, 16 Dec 2012 14:55:49 +0000 (15:55 +0100)
committerNick Schermer <nick@xfce.org>
Sun, 16 Dec 2012 14:55:49 +0000 (15:55 +0100)
thunar/thunar-tree-view.c

index 1bca480..bb976f3 100644 (file)
@@ -976,9 +976,18 @@ thunar_tree_view_row_activated (GtkTreeView       *tree_view,
 
   /* toggle the expanded state of the activated row... */
   if (gtk_tree_view_row_expanded (tree_view, path))
-    gtk_tree_view_collapse_row (tree_view, path);
+    {
+      gtk_tree_view_collapse_row (tree_view, path);
+    }
   else
-    gtk_tree_view_expand_row (tree_view, path, FALSE);
+    {
+      /* expand the row, but open it if mounted */
+      if (gtk_tree_view_expand_row (tree_view, path, FALSE))
+        {
+          /* ...open the selected folder */
+          thunar_tree_view_action_open (THUNAR_TREE_VIEW (tree_view));
+        }
+    }
 }