Implement and expose OS::shell_show_in_file_manager()

This commit is contained in:
Daylily-Zeleen 2022-12-07 11:33:35 +08:00
parent 6f1a52b017
commit b12ced0a26
12 changed files with 87 additions and 15 deletions

View file

@ -713,11 +713,8 @@ void EditorFileDialog::_item_menu_id_pressed(int p_option) {
// Specific item was clicked. Open folders directly, or the folder containing a selected file.
Dictionary item_meta = item_list->get_item_metadata(idx);
path = ProjectSettings::get_singleton()->globalize_path(item_meta["path"]);
if (!item_meta["dir"]) {
path = path.get_base_dir();
}
}
OS::get_singleton()->shell_open(String("file://") + path);
OS::get_singleton()->shell_show_in_file_manager(path, true);
} break;
}
}