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 648467 - g_app_info_set_as_last_used_for_type can wrongly change default
g_app_info_set_as_last_used_for_type can wrongly change default
Status: RESOLVED DUPLICATE of bug 658188
Product: glib
Classification: Platform
Component: gio
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-04-22 13:29 UTC by Edward Sheldrake
Modified: 2011-09-10 00:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
small test program to illustrate the problem (810 bytes, text/x-csrc)
2011-04-22 13:29 UTC, Edward Sheldrake
  Details
fix - when adding a default to avoid it being overriden, don't exclude from the apps found for the mimetype (561 bytes, patch)
2011-06-04 06:21 UTC, Edward Sheldrake
none Details | Review
desktopappinfo: don't exclude from system list (1.32 KB, patch)
2011-08-30 15:34 UTC, Edward Sheldrake
none Details | Review

Description Edward Sheldrake 2011-04-22 13:29:03 UTC
Created attachment 186478 [details]
small test program to illustrate the problem

If I use the "Open With" dialog in nautilus or file-roller 3.0.0, and choose gedit for a plain text file, gedit opens, but the default application for plain text files gets changed from gedit to KWrite.

It only happens if there was no entry for "text/plain" in the "Default Applications" section of ~/.local/share/applications/mimeapps.list - in that case, an entry gets added, but somehow ends up set to kde4-kwrite.desktop.

This is with glib 2.28.6.
Comment 1 Edward Sheldrake 2011-06-04 06:21:24 UTC
Created attachment 189202 [details] [review]
fix - when adding a default to avoid it being overriden, don't exclude from the apps found for the mimetype

I investigated this bug further, and discovered that the reason the default ends up wrong is because the app given to set_as_last_used_for_type was later being excluded from the list of apps found for that mimetype.
Comment 2 Edward Sheldrake 2011-08-30 15:34:43 UTC
Created attachment 195222 [details] [review]
desktopappinfo: don't exclude from system list

Bug still present in glib 2.29.16, here is the same patch, but git formatted and against master.
Comment 3 Cosimo Cecchi 2011-09-10 00:33:36 UTC
Bug 658188 has a better patch, closing as a duplicate.

*** This bug has been marked as a duplicate of bug 658188 ***