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 545350 - GAppInfo deletion
GAppInfo deletion
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Alexander Larsson
gtkdev
Depends on:
Blocks: 545354
 
 
Reported: 2008-07-29 17:35 UTC by David Zeuthen (not reading bugmail)
Modified: 2008-09-26 19:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (10.78 KB, patch)
2008-09-26 16:09 UTC, Matthias Clasen
committed Details | Review
test (6.98 KB, text/plain)
2008-09-26 18:00 UTC, Matthias Clasen
  Details

Description David Zeuthen (not reading bugmail) 2008-07-29 17:35:32 UTC
It would be useful to 

 - know whether a desktop file is deletable
 - be able to delete a desktop file

specifically since there's a concept of "user defined" desktop files. Right now we have no API for this. Thus I propose we should add the following API

 g_app_info_can_delete()
 g_app_info_delete()

We need API like this to add a Delete button in the "Add Application" dialog

 http://people.freedesktop.org/~david/nautilus-add-app.png

in Nautilus.
Comment 1 Matthias Clasen 2008-09-26 16:09:30 UTC
Created attachment 119433 [details] [review]
patch

Here is an untested patch that adds g_app_info_can_delete(), g_app_info_delete() and g_app_info_reset_type_associations()
Comment 2 Matthias Clasen 2008-09-26 18:00:56 UTC
Created attachment 119439 [details]
test

and here is a little test that excercises the new functions
Comment 3 Matthias Clasen 2008-09-26 19:58:04 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.