mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:47:43 +00:00
LibGUI: Add 'on_rename_successful' callback to FileSystemModel
This commit is contained in:
parent
5565db5aa1
commit
05630d2d5d
2 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue