Bug 479848 - KBibTeX defaults to the wrong PDF viewer when I click "View Document"
Summary: KBibTeX defaults to the wrong PDF viewer when I click "View Document"
Status: RESOLVED NOT A BUG
Alias: None
Product: KBibTeX
Classification: Applications
Component: General (show other bugs)
Version: 0.10
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-15 14:50 UTC by neuroshock
Modified: 2024-02-03 14:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description neuroshock 2024-01-15 14:50:09 UTC
I'm using KBibTeX 0.10 on Fedora Workstation 38 / Gnome 44.7.

Every time I click "View Document" to open a PDF for a given entry, KBibTeX opens the PDF using the wrong PDF viewer. It uses Xournal++, a PDF editor, rather than my Gnome system default, Evince.

I've double-checked that Gnome is associating PDFs with Evince, so I'm not sure how KBibTeX is picking Xournal++ instead. I also can't find any settings in KBibTeX (or in its configuration files) to choose a PDF viewer manually.
Comment 1 Thomas Fischer 2024-01-29 20:14:35 UTC
KBibTeX does not decide on its own how to open the PDF file; this decision is delegated to the KDE subsystem via KIO::OpenUrlJob: https://api.kde.org/frameworks/kio/html/classKIO_1_1OpenUrlJob.html
I guess that for KDE no PDF viewer is configured and, as it is not aware about Gnome's settings, simply picks the "first" PDF viewer which happens to be Xournal++.

As a short-term solution, you can change it either via KDE's system settings or in Dolphin via the "Open with" setting for the PDF mime type in the properties dialog available via right-click on an arbitrary PDF file.
https://userbase.kde.org/Special:MyLanguage/System_Settings/File_Associations

As a long-term solution, you can push both Gnome and KDE to figure out a way to easily synchronize file associations or honor each other's settings.
Comment 2 neuroshock 2024-02-03 14:54:14 UTC
Thanks. Based on your comment, it looks like it's possible to solve this problem by editing the file ~/.config/mimeapps.list, which appears to control file associations for KDE-based appliations like KBibTeX. If the goal is to ensure that PDF files should be associated with the Gnome app Evince, then one needs to ensure that mimeapps.list contains the following line:

application/pdf=evince.desktop;