I've noticed that magnet links are always opened in ktorrent, when I want them to open in qBittorrent. I have x-scheme-handler/magnet=qBittorrent.desktop set under Default Applications in mimeapps.list, and yet they still open in ktorrent. I did some digging and found that xdg-open uses ktraderclient5 (when using kde frameworks 5) to find what program it should open, and calling ktraderclient5 --mimetype x-scheme-handler/magnet --servicetype Application does indeed return the wrong order, with ktorrent being offer 0 and qbittorrent being offer 1. I tried calling ktraderclient (the kde 4 version), and that returns the correct order. If I run xdg-mime default qBittorrent.desktop x-scheme-handler/magnet it works for a little while, but then seems to reset itself. I'm not sure why or how. Reproducible: Always Steps to Reproduce: 1. Try to open a magnet link using xdg-open 2. 3. Actual Results: ktorrent opens even though I have qBittorrent set as the default. Expected Results: qBittorrent should open. Running Kubuntu 15.10 with kde framework 5.15.0 and plasma 5.4.3.
I believe this is try in all cases that the xdg-mime default command is having no effect on the order. I am having the same problem with xdg-mime default mozilla-thunderbird.desktop 'x-scheme-handler/mailto' No matter what KMail2.desktop is always returned.
It looks like ktraderclient5 completely ignores ~/.local/share/applications/mimeapps.list. That's actually why configuring preferred email client via systemsettings5 is ignored by xdg-open. dion@debpad:~% export XDG_UTILS_DEBUG_LEVEL=2 dion@debpad:~% xdg-mime query default "x-scheme-handler/mailto" Running KDE trader query "x-scheme-handler/mailto" mimetype and "Application" servicetype org.kde.kmail.desktop dion@debpad:~% xdg-mime default mutt_terminal.desktop x-scheme-handler/mailto make_default_kde: No kde runtime detected make_default_generic mutt_terminal.desktop x-scheme-handler/mailto Updating /home/dion/.local/share/applications/mimeapps.list dion@debpad:~% xdg-mime query default "x-scheme-handler/mailto" Running KDE trader query "x-scheme-handler/mailto" mimetype and "Application" servicetype org.kde.kmail.desktop And now let's lie to xdg-mime that we don't have KDE: dion@debpad:~% KDE_SESSION_VERSION= xdg-mime query default "x-scheme-handler/mailto" Checking /home/dion/.local/share/applications/mimeapps.list mutt_terminal.desktop
Dmitry: thanks for the precise steps. Perfect bug report. Fix coming up.
Git commit c9edc4769d278f174d821cf6d9364fbca356b676 by David Faure. Committed on 06/03/2016 at 18:35. Pushed by dfaure into branch 'master'. Fix handling of x-scheme-handler/* in mimeapps.list parsing. Since this isn't a known mimetype, such lines were being ignored. FIXED-IN: 5.21 M +1 -1 autotests/CMakeLists.txt M +3 -0 autotests/kmimeassociationstest.cpp M +4 -3 src/sycoca/kmimeassociations.cpp M +1 -1 tests/CMakeLists.txt http://commits.kde.org/kservice/c9edc4769d278f174d821cf6d9364fbca356b676
The folks at fedora have pulled and built the new package and I've verified the fix. Thanks.