GNOME Bugzilla – Bug 770109
file-operations: refactor deleting operation
Last modified: 2016-08-20 12:07:08 UTC
See patch.
Created attachment 333583 [details] [review] file-operations: refactor deleting operation Both the delete and copy operations in Nautilus deal with deleting files recursively. Each operation has its own implementation of the same functionality, mixed with specific logic, like error reporting through dialogs. In order to remove duplicated code, extract delete logic to a separate function which can be used by both operations. Implement a function for deleting files recursively which reports errors and success through an user provided callback.
Created attachment 333590 [details] [review] file-operations: refactor deleting operation Both the delete and copy operations in Nautilus deal with deleting files recursively. Each operation has its own implementation of the same functionality, mixed with specific logic, like error reporting through dialogs. In order to remove duplicated code, extract delete logic to a separate function which can be used by both operations. Implement a function for deleting files recursively which reports errors and success through an user provided callback.
Review of attachment 333590 [details] [review]: Looks good to me otherwise. ::: src/nautilus-file-operations.c @@ +4110,3 @@ + job->cancellable); + + if (file_type == G_FILE_TYPE_DIRECTORY) { You mixed the two up here.
Created attachment 333693 [details] [review] file-operations: refactor deleting operation Both the delete and copy operations in Nautilus deal with deleting files recursively. Each operation has its own implementation of the same functionality, mixed with specific logic, like error reporting through dialogs. In order to remove duplicated code, extract delete logic to a separate function which can be used by both operations. Implement a function for deleting files recursively which reports errors and success through an user provided callback.
Review of attachment 333693 [details] [review]: LGTM! ::: src/nautilus-file-operations.c @@ +1677,3 @@ + SourceInfo *source_info; + TransferInfo *transfer_info; +} DeleteData; this should be part of the job... :/ but it's ok, let's make it part of the operations refactor
Attachment 333693 [details] pushed as fe0934f - file-operations: refactor deleting operation