GNOME Bugzilla – Bug 701528
Privacy - empty trash doesn't act as expected
Last modified: 2013-08-20 13:56:14 UTC
User can notice that Purge Trash will not remove all items present in the Trash. Precondition: Ensure that you have some items (files, pictures) in the Trash. Steps: 1. Boot System 2. Go to : Settings -> Privacy -> Purge Trasht & Temporary Files 3. Click on Empty Trash 4. Go to Trash and observe that files are not removed/deleted. Expected results: Trash should be empty. Actual results: Trash is not empty.
Created attachment 247085 [details] [review] Delete leaf node files. They are not deleted when the enumeration fails
Review of attachment 247085 [details] [review]: ::: plugins/housekeeping/gsd-disk-space.c @@ +344,3 @@ files = g_file_enumerator_next_files_finish (enumerator, res, &error); + g_debug ("GsdHousekeeping: purging %d children of %s\n", g_list_length (files), data->name); Those changes should be made separately. @@ +417,3 @@ delete_batch, delete_data_ref (data)); + } else if (not_a_directory && data->depth > 0 && !g_cancellable_is_cancelled (data->cancellable)) { Instead of checking for cancelled, you'd check for: g_error_matches (error, G_IO_ERROR_ G_IO_ERROR_CANCELLED) so if the error matches G_IO_ERROR_NOT_DIRECTORY, then it won't be cancelled.
Created attachment 247153 [details] [review] Updated patch. This checks on gerror before deleting the leaf node.
Bastien, can you review this again? Thanks.
Bastien: Can you review this again? TIA
Review of attachment 247153 [details] [review]: Apart from the minor issues with the debug string, the patch seems to work fine. Please add a commit message and push to master and gnome-3-8 branches. ::: plugins/housekeeping/gsd-disk-space.c @@ +416,3 @@ + if ((data->trash && data->depth > 1) || + should_purge_file (data->file, data->cancellable, data->old)) { + g_debug ("GsdHousekeeping: purging %s leaf node\n", data->name); No need for '\n' or the 'GsdHousekeeping:' prefix here, because g_debug already adds the current log domain and a newline.
Pushed to master and gnome-3-8.