Bug 402929

Summary: .xml file assoc: Kate moves to #2 in priority list against my will
Product: [Applications] systemsettings Reporter: Alexander Potashev <aspotashev>
Component: kcm_filetypesAssignee: David Faure <faure>
Status: RESOLVED WORKSFORME    
Severity: normal CC: justin.zobel
Priority: NOR    
Version First Reported In: 5.14.4   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot right before clicking Apply

Description Alexander Potashev 2019-01-06 15:51:09 UTC
SUMMARY
.xml file assoc: Kate moves to #2 in priority list against my will.

STEPS TO REPRODUCE
1. Open file association KCM (run "kcmshell5 filetypes")
2. Select "application/xml" in the tree on the left
3. Reorder applications like in the screenshot, put Kate number 3 in the priority list.
4. Click Apply.

OBSERVED RESULT
Kate moves by itself to #2 in the priority list.

EXPECTED RESULT
Kate should stay #3 in the priority list.

SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.14.4
KDE Frameworks Version: 5.53.0
Qt Version: 5.11.1

ADDITIONAL INFORMATION
Comment 1 Alexander Potashev 2019-01-06 15:51:37 UTC
Created attachment 117307 [details]
screenshot right before clicking Apply
Comment 2 David Faure 2019-01-08 11:45:30 UTC
Please attach your ~/.local/share/applications/mimeapps.list
Comment 3 Alexander Potashev 2019-01-08 11:51:29 UTC
it's empty:

[aspotashev@glue ~]$ ls -l ~/.local/share/applications/mimeapps.list 
-rw-rw-r--. 1 aspotashev aspotashev 0 Feb 11  2018 /home/aspotashev/.local/share/applications/mimeapps.list
Comment 4 Alexander Potashev 2019-01-08 12:05:01 UTC
may be relevant:

[aspotashev@glue ~]$ cat /home/aspotashev/.local/share/applications/mimeinfo.cache 
[MIME Cache]
application/pdf=wine-extension-pdf.desktop;
application/rtf=wine-extension-rtf.desktop;
application/vnd.ms-htmlhelp=wine-extension-chm.desktop;
application/winhlp=wine-extension-hlp.desktop;
application/x-mswinurl=wine-extension-url.desktop;
application/x-mswrite=wine-extension-wri.desktop;
application/x-wine-extension-ini=wine-extension-ini.desktop;
application/x-wine-extension-msp=wine-extension-msp.desktop;
application/x-wine-extension-rev=wine-extension-rev.desktop;
application/x-wine-extension-vbs=wine-extension-vbs.desktop;
application/xml=google-chrome.desktop;wine-extension-xml.desktop;
image/gif=wine-extension-gif.desktop;
image/jpeg=wine-extension-jpe.desktop;wine-extension-jfif.desktop;
image/png=wine-extension-png.desktop;
image/webp=google-chrome.desktop;
text/html=google-chrome.desktop;wine-extension-htm.desktop;
text/plain=wine-extension-txt.desktop;
x-scheme-handler/jetbrains=jetbrains-toolbox.desktop;
x-scheme-handler/tg=telegramdesktop.desktop;
[aspotashev@glue ~]$
Comment 5 David Faure 2019-01-08 22:16:22 UTC
Forget about mimeinfo.cache, that's not used by KF5.

`kcmshell5 filetypes` is supposed to write into mimeapps.list. If it fails to do so, that would explain why changes don't stick.
But actually, I forgot that the location changed. What about ~/.config/mimeapps.list ?

Or maybe your environment points elsewhere, what does `qtpaths --locate-file GenericConfigLocation mimeapps.list` return?

If the above doesn't help finding out more, try `strace -e file kcmshell5 filetypes |& grep mimeapps` and send me the output...
Comment 6 Alexander Potashev 2019-01-09 22:28:16 UTC
Thanks!

[aspotashev@glue ~]$ qtpaths --locate-file GenericConfigLocation mimeapps.list
/home/aspotashev/.config/mimeapps.list
[aspotashev@glue ~]$ cat /home/aspotashev/.config/mimeapps.list
[Added Associations]
application/pdf=org.kde.okular.desktop;
application/rtf=libreoffice-writer.desktop;
application/xml=google-chrome.desktop;firefox.desktop;kfmclient_html.desktop;org.kde.kate.desktop;wine-extension-xml.desktop;org.kde.kwrite.desktop;libreoffice-writer.desktop;okularApplication_txt.desktop;org.kde.calligrawords_ascii.desktop;wine-extension-txt.desktop;
model/x.stl-binary=org.kde.okteta.desktop;
text/plain=org.kde.kate.desktop;

[Added KDE Service Associations]
application/xhtml+xml=khtml.desktop;webenginepart.desktop;
application/xml=khtml.desktop;webenginepart.desktop;
text/html=khtml.desktop;webenginepart.desktop;

[Default Applications]
application/pdf=org.kde.okular.desktop;
application/rtf=libreoffice-writer.desktop;
application/xml=google-chrome.desktop;
model/x.stl-binary=org.kde.okteta.desktop;
text/html=firefox.desktop
text/plain=org.kde.kate.desktop;
x-scheme-handler/http=google-chrome.desktop;
x-scheme-handler/https=google-chrome.desktop;
x-scheme-handler/jetbrains=jetbrains-toolbox.desktop
x-scheme-handler/slack=slack.desktop
x-scheme-handler/tg=telegramdesktop.desktop
[aspotashev@glue ~]$
Comment 7 Alexander Potashev 2019-01-09 22:31:27 UTC
Then I checked the filetypes KCM again and the list for application/xml is still as follows:

Google Chrome
Kate
Firefox
Konqueror
...
Comment 8 David Faure 2019-02-04 09:03:09 UTC
Seems to be the default app for text/plain, which interfers. This is a bug indeed.

(Note, if you try changing the file by hand, run kbuildsycoca5 before reopening the KCM)
Comment 9 Justin Zobel 2020-11-29 08:26:19 UTC
Thanks for the report, Alexander. I've just tested this and I cannot replicate this issue.

Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I've set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
Comment 10 Bug Janitor Service 2020-12-14 04:34:00 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2020-12-29 04:34:32 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!