Merge pull request #5587 from rfranke/issue3198

Expand subfolders in directory browser when opening folder

PR #5587
Closes #3198
This commit is contained in:
Beep6581 2020-01-24 18:31:00 +01:00 committed by GitHub
commit 227c2fbba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,9 +293,6 @@ void DirBrowser::row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk::
auto dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname));
auto subDirs = listSubDirs (dir, options.fbShowHidden);
if (subDirs.empty()) {
dirtree->collapse_row(path);
} else {
Gtk::TreeNodeChildren children = iter->children();
std::list<Gtk::TreeIter> forErase(children.begin(), children.end());
@ -321,7 +318,6 @@ void DirBrowser::row_expanded (const Gtk::TreeModel::iterator& iter, const Gtk::
dirTreeModel->set_sort_column(prevSortColumn, prevSortType);
expandSuccess = true;
}
Glib::RefPtr<Gio::FileMonitor> monitor = dir->monitor_directory ();
iter->set_value (dtColumns.monitor, monitor);
@ -383,8 +379,10 @@ void DirBrowser::row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewC
Glib::ustring dname = dirTreeModel->get_iter (path)->get_value (dtColumns.dirname);
if (Glib::file_test (dname, Glib::FILE_TEST_IS_DIR))
if (Glib::file_test (dname, Glib::FILE_TEST_IS_DIR)) {
dirSelectionSignal (dname, Glib::ustring());
dirtree->expand_row(path, false);
}
}
Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath)