Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-14-2019, 05:18 AM   #1
schmittlauch
Junior Member
schmittlauch began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2019
Device: PocketBook TouchHD 2
default viewer program: calibre doesn't adhere to xdg-mime settings

Hi,

I have the following issue: When double-clicking on a file (this case: PDF), Calibre doesn't respect the desktop-wide "open with" filetype associations:

PDF files are supposed to be opened with "okular" on my system, but are instead opened with "calibre" again which then tries to re-import them.
The "View specific format (Alt+V)" dialogue is also only partially functional:
While "View -> View specific format -> Open PDF with -> Okular" opens the correct program Okular, even a "View -> View specific format" and the double-clicking on the big PDF symbol again triggers the wrong program, in this case calibre.

Can someone point me to the relevant parts of Calibre's code responsible for opening a book after a double-click and the logic behind selecting which program to use for that? I then can try to debug this myself.

I already started with a fresh ~/.config/calibre/, that didn't help either.

I'm running Calibre on Linux, precisely on NixOS. NixOS can be a bit quirky sometimes, so I'm willing to debug this myself if someone can give me a starting point in the code.

Thanks
schmittlauch is offline   Reply With Quote
Old 02-14-2019, 05:34 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
What format calibre opens can be configured on the Behavior page of the preferences. Look at the "Use internal view for" list.
davidfor is offline   Reply With Quote
Old 02-14-2019, 07:21 AM   #3
schmittlauch
Junior Member
schmittlauch began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2019
Device: PocketBook TouchHD 2
Quote:
Originally Posted by davidfor View Post
What format calibre opens can be configured on the Behavior page of the preferences. Look at the "Use internal view for" list.
Thanks, but that doesn't solve my problem:
The "use internal viewer" checkbox was unticked all the time for PDF. When I wrote that pdf books are opened with calibre I mean that they are opened like with any other external program, just that the external program is calibre itself and not my PDF viewer "Okular".
schmittlauch is offline   Reply With Quote
Old 02-14-2019, 08:21 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre uses Qt which in turn uses xdg-open. Fix xdg-open on your system and you will be fine.
kovidgoyal is offline   Reply With Quote
Old 02-14-2019, 09:20 AM   #5
schmittlauch
Junior Member
schmittlauch began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2019
Device: PocketBook TouchHD 2
Quote:
Originally Posted by kovidgoyal View Post
calibre uses Qt which in turn uses xdg-open. Fix xdg-open on your system and you will be fine.
`xdg-open book.pdf` does indeed open my PDF viewer, while opening the same file from within calibre still has the issues I described.

@kovidgoyal: As NixOS plays some dirty tricks with enironment variables or paths I don't expect you to devote time for fixing this. But can you please point me to some code and to the Qt methods you call there? This'd really help me investigating this.

PS: as today is the "I love Free Software" day, I want to thank you for that useful piece of software you're working on (=
schmittlauch is offline   Reply With Quote
Old 02-14-2019, 09:47 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...nit__.py#L1120
kovidgoyal is offline   Reply With Quote
Reply

Tags
issue, linux


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[iOS] Problems using default settings when connecting to Calibre. svenlind Calibre Companion 6 12-20-2016 05:52 AM
Calibre Viewer Default Format slantybard Calibre 13 09-25-2016 05:08 PM
I need a solution to set default calibre viewer's window ClientAlive Calibre 2 02-15-2013 09:21 AM
Set Calibre e-book viewer as default Huisie Library Management 12 03-11-2011 08:53 PM
What Default Settings in Calibre for a Sony 505?? Ler0y Jenkins Sony Reader 8 11-27-2008 08:26 AM


All times are GMT -4. The time now is 07:01 PM.


MobileRead.com is a privately owned, operated and funded community.