GNOME Bugzilla – Bug 632154
Use nautilus to empty the trash
Last modified: 2011-02-23 14:55:35 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.
Already ported to GSettings
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).
Created attachment 181670 [details] [review] housekeeping: use the nautilus DBus API to empty trash Forgot to git add the test executable.
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.
(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.