Web lists-archives.com

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

Howdy all,
I'm working on adding Krita file support to Gwenview (https://phabricator.kde.org/D8751) and my patch works, but has the side effect of causing Krita files to prefer being opened in Gwenview rather than Krita itself. Krita should take preference when it's installed, but how is the default application ordering determined? Where should this change be made?

Thanks everyone,
Nate Graham