diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index eb03b50850..cb4b437030 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -746,7 +746,11 @@ void FileSystemModel::set_data(ModelIndex const& index, Variant const& data) if (rc < 0) { if (on_rename_error) on_rename_error(errno, strerror(errno)); + return; } + + if (on_rename_successful) + on_rename_successful(node.full_path(), new_full_path); } Vector FileSystemModel::matches(StringView const& searching, unsigned flags, ModelIndex const& index) diff --git a/Userland/Libraries/LibGUI/FileSystemModel.h b/Userland/Libraries/LibGUI/FileSystemModel.h index b523b25236..67973e5625 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.h +++ b/Userland/Libraries/LibGUI/FileSystemModel.h @@ -118,6 +118,7 @@ public: Function on_complete; Function on_directory_change_error; Function on_rename_error; + Function on_rename_successful; virtual int tree_column() const override { return Column::Name; } virtual int row_count(ModelIndex const& = ModelIndex()) const override;