mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 20:23:53 +00:00
FIX: FILE_SHOW_IN_EXPLORER now correctly shows the file's directory
This commit is contained in:
parent
4a5723f59e
commit
836565b249
@ -1034,8 +1034,19 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path) {
|
|||||||
void FileSystemDock::_file_option(int p_option) {
|
void FileSystemDock::_file_option(int p_option) {
|
||||||
switch (p_option) {
|
switch (p_option) {
|
||||||
case FILE_SHOW_IN_EXPLORER: {
|
case FILE_SHOW_IN_EXPLORER: {
|
||||||
String dir = ProjectSettings::get_singleton()->globalize_path(this->path);
|
|
||||||
OS::get_singleton()->shell_open(String("file://") + dir);
|
String path = this->path;
|
||||||
|
|
||||||
|
// first try to grab directory from selected file, so that it works for searched files
|
||||||
|
int idx = files->get_current();
|
||||||
|
|
||||||
|
if (idx >= 0 && idx < files->get_item_count()) {
|
||||||
|
path = files->get_item_metadata(idx);
|
||||||
|
path = path.get_base_dir();
|
||||||
|
}
|
||||||
|
|
||||||
|
path = ProjectSettings::get_singleton()->globalize_path(path);
|
||||||
|
OS::get_singleton()->shell_open(String("file://") + path);
|
||||||
} break;
|
} break;
|
||||||
case FILE_OPEN: {
|
case FILE_OPEN: {
|
||||||
for (int i = 0; i < files->get_item_count(); i++) {
|
for (int i = 0; i < files->get_item_count(); i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user