summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/FileSystemModel.cpp4
-rw-r--r--Userland/Libraries/LibGUI/FileSystemModel.h1
2 files changed, 5 insertions, 0 deletions
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<ModelIndex> 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<void()> on_complete;
Function<void(int error, char const* error_string)> on_directory_change_error;
Function<void(int error, char const* error_string)> on_rename_error;
+ Function<void(String const& old_name, String const& new_name)> on_rename_successful;
virtual int tree_column() const override { return Column::Name; }
virtual int row_count(ModelIndex const& = ModelIndex()) const override;