Bug 364548 - Dolphin cannot change default application for a file extension (and doesn't notify you about it)
Summary: Dolphin cannot change default application for a file extension (and doesn't n...
Status: RESOLVED WORKSFORME
Alias: None
Product: dolphin
Classification: Applications
Component: general (other bugs)
Version First Reported In: 15.12.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-20 15:35 UTC by Bzzz
Modified: 2018-04-29 20:44 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bzzz 2016-06-20 15:35:09 UTC
Changing the default application for a certain file type, e.g. JPGs, should be done via the Open -> Other... dialogue, clicking some application and ticking the "Remember association for all files" box.

This doesn't work here atm. Googling around, I found that dolphin might use ~/.local/share/applications/mimeapps.list, where my viewer for most image files is still gpicview, which I removed some while ago. When using this dialogue to open some file, it is correctly opened with the tool that I chose. The next time however, some random tool is used, up to opening the Wine Internet Explorer for a gif file for example.

I found that the mimeapps.list for some reason has ownership root:root with rwrr rights. chowning to my user account doesn't help, as the file doesn't get altered. However, it is working until the dolphin session is closed. So some second file must be in use that I do not know of.
-> Bug 1) It does not work when re-opening dolphin, so this isn't a permanent fix. Nonetheless, I think a warning message should pop up if the mimeapps.list cannot be altered and some user settings get lost because of this.
-> Bug 2) If I alter the file manually to let's say GIMP or Ristretto, dolphin instantly obeys this settings and it works as it should. We can't dolphin set this via the file extension dialogue?

Reproducible: Always

Steps to Reproduce:
1. Open your file in dolphin via Open->Other
2. Check "Remember application association for all files of type $yourfiletype"
3. Choose an application for your file
4. Click OK
5. Close dolphin and other application, open same file again

Actual Results:  
6. Some weird random application opens up

Expected Results:  
6. The exact tool that was chosen in step 3 opens the file
Comment 1 Rog131 2016-06-20 17:58:46 UTC
(In reply to Bzzz from comment #0)

> This doesn't work here atm. Googling around, I found that dolphin might use
> ~/.local/share/applications/mimeapps.list, where my viewer for most image
> files is still gpicview, which I removed some while ago. When using this
> dialogue to open some file, it is correctly opened with the tool that I
> chose. The next time however, some random tool is used, up to opening the
> Wine Internet Explorer for a gif file for example.

The ~/.local/share/apps/ is deprecated.

Possible dublicate of the https://bugs.kde.org/show_bug.cgi?id=354179 .
Comment 2 Bzzz 2016-06-20 21:46:42 UTC
Anyone cares to do some documentation and/or tell me which file is actually in use / should be used / will be used in future versions? I replaced every gpicview line in the mimeapps.list with the new application and everything works as expected. So mimeapps.list is still in use and should be updated by the "Open..." dialogue until support for this file is fully removed.
Comment 3 Rog131 2016-06-20 22:30:55 UTC
(In reply to Bzzz from comment #2)
> Anyone cares to do some documentation and/or tell me which file is actually
> in use / should be used / will be used in future versions? I replaced every
> gpicview line in the mimeapps.list with the new application and everything
> works as expected. So mimeapps.list is still in use and should be updated by
> the "Open..." dialogue until support for this file is fully removed.

The KDE is using the Freedesktop standards & specifications: https://www.freedesktop.org/wiki/

The bug 354179 report has a link to the Freedesktop specification: 'Association between MIME types and applications' - https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html

There is the lookup order for mimeapps.list.

The Dolphin 16.04.2 & kde-cli-tools 5.6.5 is saving the file associations to the $XDG_CONFIG_HOME/mimeapps.list i.e $HOME/.config/mimeapps.list 

More docs of the $XDG_CONFIG_HOME: XDG Base Directory Specification - https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Comment 4 Bzzz 2016-06-20 23:05:17 UTC
Dolphin 16.04.2 is in beta stage, I guess? Mine is from the PPA, so I thought this is the most recent stable.

My ~/.config/mimeapps.list only has these (suspicious) entries:

[Added Associations]
text/css=kwrite.desktop;
text/plain=kwrite-2.desktop;

[Default Applications]
text/css=kwrite.desktop;
text/plain=kwrite-2.desktop;
text/x-arduino=arduino-arduinoide.desktop

...and is also on 644 rights with owner root. Something must have gone wrong with the Ubuntu 14.04 -> 16.04 LTS upgrade, I don't know why any file inside a user dir should be owned by root.

I have applied the quick fix by Serhiy Zahoriya from the linked bug: Merging the ~/.local/share/applications/mimeapps.list into the ~/.config/mimeapps.list, deleting the first one, then linking via 
ln -sf ~/.config/mimeapps.list ~/.local/share/applications/mimeapps.list (just in case)

Changing a file association via the "Open..." menu now changes the mimeapps.list, which leads to a permanent change in the tool used for this file type. This is now expected behaviour. Thanks Rog131 - and maybe someone can knit this procedure into a fix for dolphin?
Comment 5 Julian Steinmann 2018-04-29 15:25:12 UTC
If I understood the discussion correctly, this bug should have been fixed with Dolphin 16.04.02. Is that indeed true? If yes, I am going to close this bug.
Comment 6 Bzzz 2018-04-29 20:44:17 UTC
Works with dolphin:amd64/xenial 4:16.04.3-0ubuntu2.1~ubuntu16.04~ppa1, so I assume that's fixed for everybody.