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 545354 - Need a way to delete "custom commands"
Need a way to delete "custom commands"
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on: 545350
Blocks:
 
 
Reported: 2008-07-29 17:57 UTC by David Zeuthen (not reading bugmail)
Modified: 2008-11-28 07:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.41 KB, patch)
2008-10-08 02:03 UTC, Matthias Clasen
committed Details | Review

Description David Zeuthen (not reading bugmail) 2008-07-29 17:57:19 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.
Comment 1 Christian Neumair 2008-09-27 11:46:08 UTC
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.
Comment 2 Matthias Clasen 2008-10-08 00:38:21 UTC
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.  
Comment 3 Matthias Clasen 2008-10-08 02:03:33 UTC
Created attachment 120174 [details] [review]
patch

A patch implementing this.
It uses new gio api in 2.19
Comment 4 Alexander Larsson 2008-10-13 12:31:35 UTC
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?
Comment 5 Matthias Clasen 2008-10-13 13:42:58 UTC
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.
Comment 6 Alexander Larsson 2008-10-13 15:03:16 UTC
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?
Comment 7 Matthias Clasen 2008-10-13 20:08:57 UTC
> 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 ?
Comment 8 Alexander Larsson 2008-10-14 17:37:03 UTC
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.
Comment 9 Matthias Clasen 2008-11-28 07:27:33 UTC
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.