1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:58:11 +00:00

Help: Clicking on link changes the treeview selection

Fixes #1259
This commit is contained in:
DexesTTP 2020-05-05 13:58:31 +02:00 committed by Andreas Kling
parent 055e955a1c
commit d1a9afa7cd
3 changed files with 27 additions and 0 deletions

View file

@ -156,6 +156,12 @@ int main(int argc, char* argv[])
char* dir_path = dirname(current_path);
char* path = realpath(String::format("%s/%s", dir_path, href.characters()).characters(), nullptr);
free(current_path);
auto tree_view_index = model->index_from_path(path);
if (tree_view_index.has_value()) {
dbg() << "Found path _" << path << "_ in model at index " << tree_view_index.value();
tree_view.selection().set(tree_view_index.value());
return;
}
history.push(path);
update_actions();
open_page(path);