GNOME Bugzilla – Bug 545354
Need a way to delete "custom commands"
Last modified: 2008-11-28 07:27:33 UTC
Nautilus allows you to create "custom commands" using the "Add Application" dialog. It would be nice to be able to delete such custom commands, e.g. for example a "Delete" button in the "Add Application" dialog. This needs API requested in gio, see bug 545350.
Isn't it already possible to delete items on the "Open With" page of the property dialog? You can recognize custom commands by the lack of an application icon.
Thats slightly different though. It removes the support for the mime type from the custom command, but it doesn't remove the custom command itself. E.g. use the "Open With" dialog to associate the custom commant "xterm" with a core file. Then open the properties dialog of that core file, and remove "xterm" from the list of associated apps in the "Open with" tab. Then open the "Open with" dialog again and notice that "xterm" is still in the list of applications. What is requested here is a way to get rid of it again.
Created attachment 120174 [details] [review] patch A patch implementing this. It uses new gio api in 2.19
The nautilus parts looks good to me. However, the gio parts may be a bit dangerous. For instance, i have most of gnome installed in a separate prefix where i have write rights. This means all such apps are listed as deletable. I guess the same would happen with system installed apps if you run nautilus as root. Is that really what we want?
We can add a g_str_has_prefix (info->filename, "userapp-") check if you think we should restrict this to files that were written by g_app_info_create_from_commandline.
Or we could check if the filename is prefixes with g_get_homedir()? Although what happens if the desktop file is just overriding a system one?
> Although what happens if the desktop file is just overriding a system one? Dunno, is that a common case ? Does nautilus allow one to create such shadowing files ?
We used to copy the desktop file (thus overriding the system one) when editing the list of supported mimetypes, but these days we have mimeapps.list. There could still be such copies around though, and other desktops might still do it.
2008-11-28 Matthias Clasen <mclasen@redhat.com> * gdesktopappinfo.c (g_app_info_can_delete): Only allow deleting files that have been created by g_app_info_create_from_commandline.