I’m using Slicer (stable 5.2.2 and preview 5.3.0-2023-06-17) on Debian 12 (bookworm) Linux with KDE. When I try to open a file using the “Edit” button in a ScriptedLoadableModule or a directory in e.g. the SlicerElastix module I get the following error and the file or directory is not opened:
[CRITICAL][FD] 19.06.2023 22:28:27 [] (unknown:0) - kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
If I do the same using Slicer that I compiled myself I get the same error (with some additional errors), but the file or directory is opened:
Here is the output I get if I run the same commands in the Python console of the pre-built Slicer 5.3.0-2023-06-17 (the files do not open):
>>> qt.QDesktopServices.openUrl(qt.QUrl("file:///home/ben", qt.QUrl.TolerantMode))
True
>>>
[FD] kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
>>> qt.QDesktopServices.openUrl(qt.QUrl("file:///home/ben/test.txt", qt.QUrl.TolerantMode))
True
>>>
[FD] kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
If I run the same commands using Slicer that I compiled myself I get the same output but the files are opened as expected.
The following xdg-open commands also work as expected even though they produce similar warnings/errors:
ben@p1:~$ xdg-open "/home/ben"
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
kf.coreaddons: Expected a KPluginFactory, got a KIOPluginForMetaData
kf.coreaddons: Expected a KPluginFactory, got a KIOPluginForMetaData
kf.coreaddons: Expected a KPluginFactory, got a KIOPluginForMetaData
kf.coreaddons: Expected a KPluginFactory, got a KIOPluginForMetaData
ben@p1:~$ cat "/home/ben/test.txt"
hello
ben@p1:~$ xdg-open "/home/ben/test.txt"
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
Hspell: can't open /usr/share/hspell/hebrew.wgz.sizes.
kf.sonnet.clients.hspell: HSpellDict::HSpellDict: Init failed
I tested this again today on a fresh install of Debian 12 Bookworm in a VirtualBox machine. To test the behavior I clicked the “Open Slicer resource file” in the “General” Application Settings. In the GNOME desktop environment, the slicerrc.py file is opened with LibreOffice writer (although the software used can be configured by the user), but in the KDE/Plasma desktop environment, I get the same behavior as described above.
Also, my Debian installation and self-built Slicer are using Qt 5.15.8 (which is working) whereas the pre-compiled stable and preview Slicer are using 5.15.2 (which is NOT working).
I am guessing that this is a bug in Qt or KDE, which may have been fixed in Qt > 5.15.2. I’ll list any relevant links here: