GNOME Bugzilla – Bug 657445
Setting app as default fails silently
Last modified: 2011-08-30 15:10:27 UTC
Created attachment 194838 [details] test.c Compile with: gcc -o test test.c `pkg-config --libs --cflags gio-unix-2.0` $ ./test --query x-scheme-handler/https Default application for 'x-scheme-handler/https': mozilla-firefox.desktop Registered applications: mozilla-firefox.desktop epiphany.desktop chromium-browser.desktop $ ./test --set x-scheme-handler/https epiphany.desktop ** Message: Set (null) as the default for x-scheme-handler/https $ ./test --query x-scheme-handler/https Default application for 'x-scheme-handler/https': mozilla-firefox.desktop Registered applications: mozilla-firefox.desktop epiphany.desktop chromium-browser.desktop update_mimeapps_list() in gdesktopappinfo.c, called from g_desktop_app_info_set_as_default_for_type() seems to fail to do anything because of how the GAppInfo was constructed.
(Note that I worked around the problem in the gvfs-mime program I just added to gvfs).
Created attachment 194854 [details] [review] gio: Error out when we cannot modify a GAppInfo g_desktop_app_info_set_as_default_for_type() and g_desktop_app_info_set_as_last_used_for_type () require the application's ID, but depending on how the GAppInfo was created, we might not be have one, and would thus silently fail to set the default application, or last used application.
Review of attachment 194854 [details] [review]: Looks good to me.
Pushed after actually testing it :) Attachment 194854 [details] pushed as 2292341 - gio: Error out when we cannot modify a GAppInfo