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 632154 - Use nautilus to empty the trash
Use nautilus to empty the trash
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: housekeeping
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on: 498506
Blocks:
 
 
Reported: 2010-10-14 15:08 UTC by Bastien Nocera
Modified: 2011-02-23 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
housekeeping: use the nautilus DBus API to empty trash (22.27 KB, patch)
2011-02-23 04:42 UTC, Cosimo Cecchi
none Details | Review
housekeeping: use the nautilus DBus API to empty trash (23.89 KB, patch)
2011-02-23 04:44 UTC, Cosimo Cecchi
committed Details | Review

Description Bastien Nocera 2010-10-14 15:08:23 UTC
There's only one settings left. Our best bet would be to add an interface to nautilus to ask it to empty the trash. This would mean removing a whole lot of code from our plugin, and make sure we don't depend on a nautilus setting for that.
Comment 1 Bastien Nocera 2010-10-19 16:18:10 UTC
Already ported to GSettings
Comment 2 Cosimo Cecchi 2011-02-23 04:42:24 UTC
Created attachment 181669 [details] [review]
housekeeping: use the nautilus DBus API to empty trash

Attached patch makes use of Nautilus' DBus API to empty the trash instead of manually recreating an "Empty Trash" dialog.
It will use DBus autostart to start up nautilus in case it's not running (nautilus won't present any windows in that case).
Comment 3 Cosimo Cecchi 2011-02-23 04:44:41 UTC
Created attachment 181670 [details] [review]
housekeeping: use the nautilus DBus API to empty trash

Forgot to git add the test executable.
Comment 4 Bastien Nocera 2011-02-23 12:32:22 UTC
Review of attachment 181670 [details] [review]:

Feel free to commit after those 2 fixes, thanks!

::: plugins/housekeeping/gsd-disk-space.c
@@ +225,3 @@
+        g_dbus_proxy_call_finish (proxy, res, &error);
+
+        GDBusProxy *proxy = G_DBUS_PROXY (object);

if (g_dbus_proxy_call_finish () == FALSE)

@@ +245,3 @@
+        proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+
+

I'd rather proxy == NULL here.
Comment 5 Cosimo Cecchi 2011-02-23 14:55:35 UTC
(In reply to comment #4)

Thanks for the review.

> if (g_dbus_proxy_call_finish () == FALSE)

You can't do that, as g_dbus_proxy_call_finish() returns a GVariant, not a gboolean, and EmptyTrash() does not have return value, so I left the check on the GError here.

Closing as FIXED.