Any documentation for preferred://[...] URI schema?

Is there documentation for the preferred:// URI schema somewhere? As far as I understand, this is only used by KDE, right? If this is not the case, I’m happy to be referred elsewhere.

Specifically, my main questions are:

  • I only know about preffered://filemanager and preferred://browser myself. Are there additional such URIs e.g. anything like preferred://editor?
  • How can I manually see what these resolve to?
  • How is it determined what these resolve to? Do they use some internal KDE settings, or xdg stuff, or something else?

Note that I already asked this in the KDE User Help Matrix chat, but got no answer. If necessary, I can of course close this as a duplicate.

2 Likes

Did you ever find anything related to this. I have the same question and this post was all I could find after about 20 minutes of googling

I haven’t heard about this protocol before.

Doesn’t seem to be available by default on KDE Neon either.

Which distribution are you using? Which version of Plasma?

As for the settings this is very likely accessing $XDG_CONFIG_HOME/mimeapps.lst, with XDG_CONFIG_HOME defaulting to $HOME/.config/ if not set

I have myself only seen this schema mentioned in the context of KDE, see e.g. bug report number 436667 (sorry don’t have enough posts to be allowed to include links)
or this part of the docs/source for the Icons-only task manager: /applets/taskmanager/package/contents/config/main.xml#L100 (in the plasma-desktop repository).

Aha! A Plasma internal thing.
That explains why it didn’t work in Dolphin :slight_smile:

From what I can see it understands the following keys (host part of the URL): mailer, browser, terminal, filemanager.

Everything else is considered a MIME type and its default handler.
Not sure how useful that is given that the host part of an URL does not contain any forward slashes but MIME types do.

I guess it could work for MIME type main categories such as image or text

Ah thank you, it’s very nice to know that MIME type main categories should also work.

Let’s call it an “educated guess” :slight_smile:

The URL is essentially handled by this function: it extracts the host part of the URL and checks it against the keys I’ve outlined earlier.

If there is no match it passes the info on to a KDE framework function that expects a MIME type.

How that function treats a partial MIME type is unclear.

Probably easier to test this than trying to follow the code, potentially deep into Qt

2 Likes