Web lists-archives.com

Re: What controls the default ordering of which application handles an opened file?




On 11/16/17 6:29 AM, Harald Sitter wrote:
The KService frameworks supports a special desktop entry key [3]
`X-KDE-InitialPreference` meaning to solve this. It assigns a custom
preference score (higher=more preferred) to all mime types associated
with the desktop file.
To solve the problem with krita there probably needs to be a separate
krita desktop file which is `NoDisplay=true` and only associates with
the krita mimetype `MimeType=application/x-krita;` and sets
`X-KDE-InitialPreference=10` to gain preference over gwenview. This
will only impact kde-frameworks based software though, other xdg spec
compliant mimetype handlers do not necessarily respect our
InitialPreference score!

In the end I don't think there is a proper cross-desktop way of doing
this by default. Usually people simple set X-KDE-InitialPreference and
move on.

[1] https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#mime-types
[2] https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.1.html#associations
[3] https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#kde-items

HS


I finally got around to implementing this, more than a year later. :)

Thanks for your help, Harald. You definitely pointed me in the right direction.

Here are the patches:
- https://phabricator.kde.org/D19120
- https://phabricator.kde.org/D19121

Nate