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 545351 - Reset associations for content type
Reset associations for content type
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Alexander Larsson
gtkdev
Depends on:
Blocks: 545356
 
 
Reported: 2008-07-29 17:40 UTC by David Zeuthen (not reading bugmail)
Modified: 2008-09-26 19:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Zeuthen (not reading bugmail) 2008-07-29 17:40:04 UTC
With the latest desktop file based gio, one can now remove associations from an application to a content type, in particular if you have

[Removed Associations]
x-content/acme-device-frobnicator=acme-app.desktop

in ~/.local/share/applications/mimeapps.list it means you've removed the association "x-content/acme-device-frobnicator" from the acme-app.desktop application. This works even if acme-app is installed system-wide.

Thus the "Remove" button in

 http://people.freedesktop.org/~david/nautilus-open-with.png

will happily let you remove "gThumb Image Viewer" and there's no apparent way to get it back. Hence, in that dialog in Nautilus it would be useful with a "Reset Associations" button. Therefore, I propose the addition of new API

 g_content_type_reset_associations()

to reset all application associations for a given file.
Comment 1 Matthias Clasen 2008-09-26 16:10:49 UTC
I've included an implementation of g_app_info_reset_type_associations() in the patch attached to bug 545350
Comment 2 Matthias Clasen 2008-09-26 19:56:46 UTC
2008-09-26  Matthias Clasen  <mclasen@redhat.com>

        Bug 545350 – GAppInfo deletion
        Bug 545351 – Reset associations for content type

        * gio.symbols:
        * gappinfo.[hc]: New functions g_app_info_can_delete,
        g_app_info_delete and g_app_info_reset_type_associations.

        * gdesktopappinfo.c:
        * gwin32appinfo.c: Implementations of these.

        * tests/Makefile.am:
        * tests/desktop-app-info.c: Tests for GAppInfo functionality.