GNOME Bugzilla – Bug 153058
default apps: use the system preference before the user one
Last modified: 2004-12-22 21:47:04 UTC
One exemple on my system with ogg files. 1- The system default is totem: $ grep ogg /usr/share/applications/defaults.list application/ogg=totem.desktop 2. I've selected an ogg file in nautilus -> properties -> open with and added xmms (small problem the radio button selection is not changed in the list when I select it, but that's a nautilus problem) 3. I close the dialog, nautilus has written this: $ cat ~/.local/share/applications/defaults.list [Default Applications] application/ogg=xmms.desktop 4. nautilus still uses totem to open my ogg files. 5. if I remove the entry in /usr/share/applications/defaults.list it uses xmms => apparently the system preferences are used before the user ones. My system is a full 2.8 one.
mime=gnome_vfs_mime_get_default_application ("application/ogg"); printf("Name: %s\nApp: %s\n", mime->name, mime->command); This codes returns: Name: Totem Movie Player App: totem in fact in gnome_vfs_mime_get_default_desktop_entry (): * dir_list = mime_info_cache->defaults_list_dirs; returns /etc/xdg/mime * dir_list = mime_info_cache->dirs; returns /usr/share/applications /usr/local/share/applications /home/user/.local/share/applications The functions stops on the first matching file which is in the system dir. gnome_vfs_mime_info_cache_get_search_path () puts the user dir at the end of the list: args[length] = g_build_filename (user_data_dir, "applications", NULL); Not sure if the order should be changed in the cache (the user dir is probably at the end for a reason), what do you think ?
The order of the search paths looks totally wrong to me. And not reverting args in gnome_vfs_mime_info_cache_get_search_path and gnome_vfs_mime_info_cache_get_defaults_search_path fixes this issue for me. However, someone spent time actually reversing those arrays, so maybe i'm missing something here. Dave? jrb?
Created attachment 31719 [details] [review] Possibly correct patch I added a patch that fixes this, unless there is some reason for reversing the path orders.
In cvs now.