~jeremywootten/pantheon-files/fix-backspace-in-columnv-view

« back to all changes in this revision

Viewing changes to src/View/AbstractTreeView.vala

  • Committer: jeremy at elementaryos
  • Date: 2016-04-30 11:11:40 UTC
  • mfrom: (2023.1.107 pantheon-files)
  • Revision ID: jeremy@elementaryos.org-20160430111140-ez2siepsfxwj9asi
Merge trunk to r2130

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
 
133
133
        public override void select_path (Gtk.TreePath? path) {
134
134
            if (path != null) {
135
 
                debug ("select path %s", path.to_string ());
 
135
                var selection = tree.get_selection ();
 
136
                /* Unlike for IconView, set_cursor unselects previously selected paths (Gtk bug?),
 
137
                 * so we have to remember them and reselect afterwards */ 
 
138
                GLib.List<Gtk.TreePath> selected_paths = null;
 
139
                selection.selected_foreach ((m, p, i) => {
 
140
                    selected_paths.prepend (p);
 
141
                });
136
142
                /* Ensure cursor follows last selection */
137
 
                tree.set_cursor (path, null, false);
138
 
                tree.get_selection ().select_path (path);
 
143
                tree.set_cursor (path, null, false);  /* This selects path but unselects rest! */
 
144
                selection.select_path (path);
 
145
                selected_paths.@foreach ((p) => {
 
146
                    selection.select_path (p);
 
147
                });
139
148
            }
140
149
        }
141
150
        public override void unselect_path (Gtk.TreePath? path) {
297
306
                tree_frozen = false;
298
307
            }
299
308
        }
 
309
 
 
310
        protected override void freeze_child_notify () {
 
311
            tree.freeze_child_notify ();
 
312
        }
 
313
 
 
314
        protected override void thaw_child_notify () {
 
315
            tree.thaw_child_notify ();
 
316
        }
300
317
    }
301
318
}