SUMMARY This is related to, but not quite the same as, Bug 425154 (see last comment), which describes a corner case that still needs to be addressed... Basically, if a mimetype inherits the same application twice (which can easily happen in multiple-inheritance cases), KDE will show the application twice in menus and the system settings module. STEPS TO REPRODUCE 1. Create a JSON file. 2. Set okular to open the mimetypes "application/x-executable" and "text/plain". Apply changes. 3. Right click on the JSON file in dolphin, and see what programs are made available to open the file. OBSERVED RESULT Okular appears twice in the results. EXPECTED RESULT Okular appears once in the results, at the position it inherits *first* in a breadth-first search of the inherited mimetypes of application/json. SOFTWARE/OS VERSIONS Linux: Arch Linux (kernel 5.17.1) KDE Plasma Version: 5.24.4 (X11) KDE Frameworks Version: 5.93.0 Qt Version: 5.15.3 ADDITIONAL INFORMATION The positions Okular appears at in the results appear to suggest that kservice is searching the inherited mimetypes in depth-first order instead of breadth-first. This is incorrect and leads to the corner case issue described in the comments of Bug 425154.
First things first, could you verify you only have one okular .desktop file in /usr/share/applications/ and ~/.local/share/applications/ ?
To be more exact (because okular installs many .desktop files), org.kde.okular.desktop is the main one.
(In reply to Ahmad Samir from comment #1) > First things first, could you verify you only have one okular .desktop file > in /usr/share/applications/ and ~/.local/share/applications/ ? Yes, I only have /usr/share/applications/org.kde.okular.desktop
I believe this has been fixed, probably as part of Bug 475200. There is a related bug where certain applications that provide multiple .desktop files will be shown twice (or more). Okular is one of these: https://bugs.kde.org/show_bug.cgi?id=481473 There is a related bug describing user-confusing situations where an app unexpectedly inherits a file type due to a low level mimetype assignment like application/octet-stream: Bug 425154. Fortunately this situation is now much less painful thanks to two fixes to inheritance ordering. Okular should no longer take over all your files like it used to do. I think I have managed to find and report all other issues with file associations, and they're now fixed as of Plasma 6!