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 153058 - default apps: use the system preference before the user one
default apps: use the system preference before the user one
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: MIME and file/program mapping
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2004-09-19 10:03 UTC by Sebastien Bacher
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Possibly correct patch (2.17 KB, patch)
2004-09-20 12:11 UTC, Alexander Larsson
none Details | Review

Description Sebastien Bacher 2004-09-19 10:03:03 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.
Comment 1 Sebastien Bacher 2004-09-19 14:12:53 UTC
  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 ?
Comment 2 Alexander Larsson 2004-09-20 12:10:01 UTC
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?

Comment 3 Alexander Larsson 2004-09-20 12:11:35 UTC
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.
Comment 4 Alexander Larsson 2004-09-21 08:26:40 UTC
In cvs now.