I'm trying to debug a problem with opening CBR files in Calibre (it was explained here). Specific Callibre problem is mostly not revelant, and it boild down to the issue that files and folders are opened by improper external programs.
After some debugging I found out that the culprit is most probably a call to QDesktopServices.openUrl(qurl)
which selects wrong application to handle a specific file.
Qt documentation is somewhat laconic as to how this method works (I really care about Python version, but I guess that behaviour is identical):
If the URL is a reference to a local file (i.e., the URL scheme is "file") then it will be opened with a suitable application instead of a Web browser.
My linux enviorment seems to be configured properly, if I double click on this file in Nautilus (I don't really have full KDE enviorment ready) it opens in a proper program.
So questions are:
openUrl
find proper application to open a file. After some additional research it turns out that QDesktopServices.openUrl
uses XDG utulities under the hood. Results are consistent whith xdg-open
.