After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701528 - Privacy - empty trash doesn't act as expected
Privacy - empty trash doesn't act as expected
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: housekeeping
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-03 14:04 UTC by Ewan.LEBIDEAU-CANEVET
Modified: 2013-08-20 13:56 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8


Attachments
Delete leaf node files. They are not deleted when the enumeration fails (2.83 KB, patch)
2013-06-18 05:01 UTC, Srinivasa Ragavan
needs-work Details | Review
Updated patch. This checks on gerror before deleting the leaf node. (1.50 KB, patch)
2013-06-18 14:13 UTC, Srinivasa Ragavan
accepted-commit_now Details | Review

Description Ewan.LEBIDEAU-CANEVET 2013-06-03 14:04:51 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.
Comment 1 Srinivasa Ragavan 2013-06-18 05:01:10 UTC
Created attachment 247085 [details] [review]
Delete leaf node files. They are not deleted when the enumeration fails
Comment 2 Bastien Nocera 2013-06-18 08:56:13 UTC
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.
Comment 3 Srinivasa Ragavan 2013-06-18 14:13:31 UTC
Created attachment 247153 [details] [review]
Updated patch. This checks on gerror before deleting the leaf node.
Comment 4 Srinivasa Ragavan 2013-06-24 02:50:18 UTC
Bastien, can you review this again? Thanks.
Comment 5 Srinivasa Ragavan 2013-07-02 10:34:38 UTC
Bastien: Can you review this again? TIA
Comment 6 Thomas Wood 2013-07-18 16:25:07 UTC
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.
Comment 7 Srinivasa Ragavan 2013-08-20 13:56:14 UTC
Pushed to master and gnome-3-8.