Merge pull request #5587 from rfranke/issue3198
Expand subfolders in directory browser when opening folder PR #5587 Closes #3198
This commit is contained in:
commit
227c2fbba7
@ -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 dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname));
|
||||||
auto subDirs = listSubDirs (dir, options.fbShowHidden);
|
auto subDirs = listSubDirs (dir, options.fbShowHidden);
|
||||||
|
|
||||||
if (subDirs.empty()) {
|
|
||||||
dirtree->collapse_row(path);
|
|
||||||
} else {
|
|
||||||
Gtk::TreeNodeChildren children = iter->children();
|
Gtk::TreeNodeChildren children = iter->children();
|
||||||
std::list<Gtk::TreeIter> forErase(children.begin(), children.end());
|
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);
|
dirTreeModel->set_sort_column(prevSortColumn, prevSortType);
|
||||||
|
|
||||||
expandSuccess = true;
|
expandSuccess = true;
|
||||||
}
|
|
||||||
|
|
||||||
Glib::RefPtr<Gio::FileMonitor> monitor = dir->monitor_directory ();
|
Glib::RefPtr<Gio::FileMonitor> monitor = dir->monitor_directory ();
|
||||||
iter->set_value (dtColumns.monitor, monitor);
|
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);
|
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());
|
dirSelectionSignal (dname, Glib::ustring());
|
||||||
|
dirtree->expand_row(path, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath)
|
Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user