Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix folder moving in file system dock #81725

Merged

Conversation

Rindbee
Copy link
Contributor

@Rindbee Rindbee commented Sep 16, 2023

Include files in the folder that will be moved/renamed when looking up the file owner.

Fixed issue when moving/renaming directories, see #77289 (comment).

Rename the function/variable names to make more sense.
1

@Rindbee Rindbee requested a review from a team as a code owner September 16, 2023 07:49
@Rindbee Rindbee force-pushed the fix-folder-moving-in-FileSystemDock branch from 5e40d37 to f5adbfc Compare September 16, 2023 07:53
@AThousandShips AThousandShips added this to the 4.2 milestone Sep 16, 2023
@Rindbee Rindbee force-pushed the fix-folder-moving-in-FileSystemDock branch 2 times, most recently from 3d73d08 to fc36d9c Compare September 16, 2023 08:16
editor/filesystem_dock.cpp Show resolved Hide resolved
editor/filesystem_dock.cpp Outdated Show resolved Hide resolved
editor/filesystem_dock.cpp Outdated Show resolved Hide resolved
@Rindbee Rindbee force-pushed the fix-folder-moving-in-FileSystemDock branch from fc36d9c to 2073555 Compare September 16, 2023 09:56
@KoBeWi
Copy link
Member

KoBeWi commented Sep 28, 2023

It's still possible to break dependencies if you rename a folder (tested with inherited scenes).

Also doing specific steps, you can cause a crash:

================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.2.dev.custom_build (4c3dc26367518e006f8555c12f5d2df0b8a28192)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] CowData<EditorFileSystemDirectory::FileInfo *>::_get_size (C:\godot_source\core\templates\cowdata.h:81)
[1] CowData<EditorFileSystemDirectory::FileInfo *>::size (C:\godot_source\core\templates\cowdata.h:134)
[2] Vector<EditorFileSystemDirectory::FileInfo *>::size (C:\godot_source\core\templates\vector.h:93)
[3] EditorFileSystemDirectory::get_file_count (C:\godot_source\editor\editor_file_system.cpp:91)
[4] FileSystemDock::_before_move (C:\godot_source\editor\filesystem_dock.cpp:1967)
[5] FileSystemDock::_rename_operation_confirm (C:\godot_source\editor\filesystem_dock.cpp:1780)
[6] call_with_variant_args_helper<FileSystemDock> (C:\godot_source\core\variant\binder_common.h:308)
[7] call_with_variant_args<FileSystemDock> (C:\godot_source\core\variant\binder_common.h:418)
[8] CallableCustomMethodPointer<FileSystemDock>::call (C:\godot_source\core\object\callable_method_pointer.h:105)
[9] Callable::callp (C:\godot_source\core\variant\callable.cpp:51)
[10] Object::emit_signalp (C:\godot_source\core\object\object.cpp:1118)
[11] Node::emit_signalp (C:\godot_source\scene\main\node.cpp:3596)
[12] Object::emit_signal<> (C:\godot_source\core\object\object.h:920)
[13] Tree::item_edited (C:\godot_source\scene\gui\tree.cpp:4342)
[14] Tree::_line_editor_submit (C:\godot_source\scene\gui\tree.cpp:3131)
[15] call_with_variant_args_helper<Tree,String,0> (C:\godot_source\core\variant\binder_common.h:308)
[16] call_with_variant_args<Tree,String> (C:\godot_source\core\variant\binder_common.h:418)
[17] CallableCustomMethodPointer<Tree,String>::call (C:\godot_source\core\object\callable_method_pointer.h:105)
[18] Callable::callp (C:\godot_source\core\variant\callable.cpp:51)
[19] Object::emit_signalp (C:\godot_source\core\object\object.cpp:1118)
[20] Node::emit_signalp (C:\godot_source\scene\main\node.cpp:3596)
[21] Object::emit_signal<String> (C:\godot_source\core\object\object.h:920)
[22] LineEdit::gui_input (C:\godot_source\scene\gui\line_edit.cpp:480)
[23] Control::_call_gui_input (C:\godot_source\scene\gui\control.cpp:1810)
[24] Viewport::_gui_input_event (C:\godot_source\scene\main\viewport.cpp:2236)
[25] Viewport::push_input (C:\godot_source\scene\main\viewport.cpp:3186)
[26] Window::_window_input (C:\godot_source\scene\main\window.cpp:1549)
[27] call_with_variant_args_helper<Window,Ref<InputEvent> const &,0> (C:\godot_source\core\variant\binder_common.h:303)
[28] call_with_variant_args<Window,Ref<InputEvent> const &> (C:\godot_source\core\variant\binder_common.h:418)
[29] CallableCustomMethodPointer<Window,Ref<InputEvent> const &>::call (C:\godot_source\core\object\callable_method_pointer.h:105)
[30] Callable::callp (C:\godot_source\core\variant\callable.cpp:51)
[31] DisplayServerWindows::_dispatch_input_event (C:\godot_source\platform\windows\display_server_windows.cpp:2628)
[32] DisplayServerWindows::_dispatch_input_events (C:\godot_source\platform\windows\display_server_windows.cpp:2605)
[33] Input::_parse_input_event_impl (C:\godot_source\core\input\input.cpp:751)
[34] Input::flush_buffered_events (C:\godot_source\core\input\input.cpp:1013)
[35] DisplayServerWindows::process_events (C:\godot_source\platform\windows\display_server_windows.cpp:2317)
[36] OS_Windows::run (C:\godot_source\platform\windows\os_windows.cpp:1474)
[37] widechar_main (C:\godot_source\platform\windows\godot_windows.cpp:182)
[38] _main (C:\godot_source\platform\windows\godot_windows.cpp:204)
[39] main (C:\godot_source\platform\windows\godot_windows.cpp:218)
[40] WinMain (C:\godot_source\platform\windows\godot_windows.cpp:232)
[41] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[42] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================
godot.windows.editor.dev.x86_64_hzSjn067Sn.mp4

(B inherits A)

@Rindbee Rindbee force-pushed the fix-folder-moving-in-FileSystemDock branch 2 times, most recently from 00e3164 to 6d7f6de Compare September 29, 2023 00:27
@Rindbee
Copy link
Contributor Author

Rindbee commented Sep 29, 2023

It's still possible to break dependencies if you rename a folder (tested with inherited scenes).
Also doing specific steps, you can cause a crash:

to_move was not used when renaming.
Has been fixed, and rebased.

editor/filesystem_dock.cpp Outdated Show resolved Hide resolved
Include files in the folder that will be moved/renamed when looking up the file owner.

Rename the function/variable names to make more sense in FileSystemDock
@Rindbee Rindbee force-pushed the fix-folder-moving-in-FileSystemDock branch from 6d7f6de to 1cb1d7f Compare September 29, 2023 12:32
@akien-mga akien-mga merged commit 48ef57d into godotengine:master Sep 29, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@Rindbee Rindbee deleted the fix-folder-moving-in-FileSystemDock branch September 29, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants