Bug 354179 - File associations cannot be changed if already defined in $XDG_CONFIG_HOME/mimeapps.list
Summary: File associations cannot be changed if already defined in $XDG_CONFIG_HOME/mi...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_filetypes (show other bugs)
Version: 5.4.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 356235 360189 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-10-21 15:17 UTC by Qianli Ma
Modified: 2016-11-10 10:29 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Qianli Ma 2015-10-21 15:17:43 UTC
If added associations or default applications are written to $XDG_CONFIG_HOME/mimeapps.list by other programs (e.g. gnome programs), they cannot be modified in systemsettings.  After modify the application preference order and apply, the order will change back to the original one.


Reproducible: Always

Steps to Reproduce:
1. Create mimeapps.list in $HOME/config, add an application preference order for a certain mime type as "Added Associations".
2. Modify the preference order in systemsettings and apply.
3. After a second or so the listed order jumps back to the one configured in $HOME/config/mimeapps.list.  i.e. the preference order cannot be modified in systemsettings.


Actual Results:  
$HOME/.local/share/applications/mimeapps.list is properly modified by systemsettings but the file associations will be overridden by $HOME/config/mimeapps.list.

Expected Results:  
systemsettings shall modify $XDG_CONFIG_HOME/mimeapps.list instead of $XDG_DATA_HOME/applications/mimeapps.list, or at least remove relevant entries in $XDG_CONFIG_HOME/mimeapps.list.


According to http://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html the mimeapps.list at $XDG_CONFIG_HOME shall have higher priority than the one stored in $XDG_DATA_HOME/applications. systemsettings modifies the file in $XDG_DATA_HOME/applications and the modifications will not be honored by KMimeTypeTrader (or KSycoca, xdg-mime, etc) when conflicting configurations exit in $XDG_CONFIG_HOME.

Also $XDG_CONFIG_HOME is "the recommended location for user configuration GUIs".
Comment 1 sedrubal 2015-11-06 15:38:43 UTC
Also reproducible here.
Comment 2 Martin Tlustos 2015-12-02 10:09:02 UTC
Same here, kubuntu 15.10, plasma 5.4.2
Comment 3 Martin Tlustos 2015-12-02 10:09:36 UTC
Seems to be related or the same to 353475
Comment 4 Qianli Ma 2015-12-02 10:17:20 UTC
A workaround on the user side is to merge $HOME/.local/share/applications/mimeapps.list to $HOME/.config/mimeapps.list, and create a symbolic link to $HOME/.config/mimeapps.list at $HOME/.local/share/applications. Systemsettings then works fine.
Comment 5 Alexander Nolting 2015-12-07 17:19:42 UTC
Same on openSUSE TW, under KDF 5.16, systemsettings 5.4.3, QT 5.5.1
Comment 6 Colin 2015-12-25 18:43:50 UTC
Why is this still "UNCONFIRMED". It's clearly confirmed and a major issue for the Plasma Desktop.

This table in the Arch Wiki will help the developers to solve this problem:

https://wiki.archlinux.org/index.php/Default_applications#MIME_types_and_desktop_entries

It shows the order of paths that are searched to find mimeapps.list. From this table, it is obvious that the defaults set by Plasma Desktop should ideally be stored in

    $HOME/.config/$desktop-mimeapps.list

Or, at least in

    $HOME/.config/mimeapps.list
Comment 7 David Faure 2015-12-28 23:07:34 UTC
Git commit c4ebd9b537d749e5533ecaff5631debab4827760 by David Faure.
Committed on 28/12/2015 at 23:07.
Pushed by dfaure into branch 'master'.

Save settings into ~/.config rather than deprecated ~/.local/share/apps/

M  +1    -1    keditfiletype/mimetypedata.cpp

http://commits.kde.org/kde-cli-tools/c4ebd9b537d749e5533ecaff5631debab4827760
Comment 8 Rex Dieter 2016-03-07 15:23:07 UTC
*** Bug 356235 has been marked as a duplicate of this bug. ***
Comment 9 Serhiy Zahoriya 2016-05-19 21:19:33 UTC
The workaround in one command:
ln -sf ~/.config/mimeapps.list ~/.local/share/applications/mimeapps.list
Comment 10 Wolfgang Bauer 2016-06-02 18:38:03 UTC
*** Bug 360189 has been marked as a duplicate of this bug. ***
Comment 11 piedro 2016-10-24 20:43:49 UTC
The workaround doesn't help - I still can't change the *.aac association. If I do it just jumps back to audacious in my case. 

Also there is no way to reset all the mime types or at least one by one to default settings. 
The button "load defaults in the systemsettings is just greyed out. 

Frustrating because this seems a major problem for anyone actually working on KDE. 

thx for reading, please fix this or give some workaround instructions, 
piedro
Comment 12 Henrique Sant'Anna 2016-11-10 10:29:09 UTC
Still happens in 5.8.3.

The workaround seems to be working, after creating the link (as in comment9) I could edit mimetype settings and it will correctly be saved.

Sometimes you have to recreate the symbolic link, because package updates can replace it.