Bug 445934 - kpdf preview is broken in kile
kpdf preview is broken in kile
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: kile (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: Kevin Kofler
Fedora Extras Quality Assurance
: Reopened
: 446569 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-09 18:15 EDT by Jakub Hrozek
Modified: 2009-02-04 17:50 EST (History)
4 users (show)

See Also:
Fixed In Version: 2.0.1-2.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-24 22:51:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Default to Okular for ViewDVI, ForwardDVI, ViewPDF, ViewPS (5.69 KB, patch)
2008-05-10 19:39 EDT, Kevin Kofler
no flags Details | Diff
Default to xdg-open for ViewDVI, ForwardDVI, ViewPDF, ViewPS (5.76 KB, patch)
2008-05-11 00:28 EDT, Kevin Kofler
no flags Details | Diff

  None (edit)
Description Jakub Hrozek 2008-05-09 18:15:02 EDT
Description of problem:
In F9, the kpdf preview doesn't work even with installed kdegraphics3 

Version-Release number of selected component (if applicable):
kile-2.0-4.fc9

How reproducible:
always

Steps to Reproduce:
1. install kile
2. write some latex code
3. hit preview
  
Actual results:
[ViewPDF}:  finished with exit status 127

Expected results:
PDF preview

Additional info:
Initially, I thought that this might be just a packaging bug (missing
Requires:), but after discussion on #fedora-kde, this might actually involve
fixing other things:

[23:57] <Kevin_Kofler> You can set it up by hand to launch an external Okular to
view DVI, PDF and PS files, it should probably default to that in F9.
[00:01] <Kevin_Kofler> The embedded preview at the bottom will probably have to
be disabled entirely in F9. We don't have the KDE 3 KParts to make that happen.
[00:01] <Kevin_Kofler> What we can do is fix the default configuration for
View{DVI,PS,PDF} to launch Okular (as a standalone app, we can't embed KDE 4
KParts into a KDE 3 app).
Comment 1 Kevin Kofler 2008-05-10 18:51:08 EDT
What I've figured out is:
* The embedded preview in the bottom tab uses no KParts, only QImage (it 
converts to PNG, then shows that with a QImage), so that should be working 
already.
* However, the default configuration is _not_ to use that embedded preview, but 
always launching the KParts or standalone executables configured in the View* 
actions.
In other words, fixing View{DVI,PS,PDF} will also fix the problem when hitting 
preview.

I also figured out how to do that, I'll have a patch shortly.
Comment 2 Kevin Kofler 2008-05-10 19:39:13 EDT
Created attachment 305042 [details]
Default to Okular for ViewDVI, ForwardDVI, ViewPDF, ViewPS

This patch makes Kile default to Okular (as an external process, can't embed
KDE 4 KParts into KDE 3 apps) for the ViewDVI, ForwardDVI, ViewPDF and ViewPS
actions. I'm not sure whether Okular will do the right thing for ForwardDVI
(it's supposed to point to the current editor location in the DVI file), but
calling a nonexistent KDVI isn't really a sensible default in any case. ;-)

WARNING: This patch is for F9+ only. Making Okular the default is not a good
idea on F8- for obvious reasons. ;-) If we want to add Okular as an option in
F8 for kde-redhat unstable users, we'd have to split the kconf_update script
into the part which adds the option and the part which makes it default and
only do the former in F8.

We may want to also add a Requires: kdegraphics to make the default
configuration "just work".
Comment 3 Rex Dieter 2008-05-10 20:51:20 EDT
Why not just use xdg-open (instead of hard-coding okular)?
Comment 4 Kevin Kofler 2008-05-10 20:59:44 EDT
Because we have no idea what app will end up as the default if you have 
multiple ones installed due to shared-mime-info? (Actually, I suspect I know 
the answer: evince... :-/)
Comment 5 Kevin Kofler 2008-05-11 00:28:27 EDT
Created attachment 305052 [details]
Default to xdg-open for ViewDVI, ForwardDVI, ViewPDF, ViewPS

Anyway, here's a version of the patch which uses xdg-open.
Comment 6 Fedora Update System 2008-05-12 19:54:27 EDT
kile-2.0.1-1.fc9 has been submitted as an update for Fedora 9
Comment 7 Fedora Update System 2008-05-13 11:27:12 EDT
kile-2.0.1-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kile'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-3596
Comment 8 Bug Zapper 2008-05-14 06:56:27 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 9 Fedora Update System 2008-05-14 18:14:18 EDT
kile-2.0.1-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Kevin Kofler 2008-05-15 00:39:09 EDT
*** Bug 446569 has been marked as a duplicate of this bug. ***
Comment 11 Peeter Puusemp 2008-06-21 21:13:42 EDT
I have the latest Kile available from the updates.

The embedded preview at the bottom works, if to check the check boxes in
Tools-->Preview in the configuration dialog, but if they are not selected, then
Kile doesn't load externally DVI or PDF viewer with the preview.

I checked and xdg-open is default for ViewDVI, ForwardDVI, ViewPDF, ViewPS.

* If LaTeX-->DVI is selected there, then the log says:

...
[ViewDVI] kviewerpart teeki ei leitud.


It means that kviewerpart (library?) wasn't found.

* If PDFLaTeX-->PDF is selected, then the log says:

...
[Kile] Seadistuste andmebaasis ei leitud tööriista ViewPDF.


It means that the tool ViewPDF wasn't found in the settings database (or
something like that).



-----

I have one more remark.

The math group quick preview is by default noted (in Tools-->Preview in the
configuration dialog) to be always opened externally and the check box is
disabled. I accidentally figured out that if to install dvipng package then the
check box gets enabled and it is then possible to preview a math group with
embedded preview at the bottom. I think there should be a note that dvipng
package is needed to enable the possibility of embedded preview of math groups.
At the moment it is not clear.
Comment 12 Kevin Kofler 2008-06-21 22:34:12 EDT
There are 3 types of preview:
1. embedded in the bottom pane: that uses dvipng and should work fine
2. embedded viewer in a separate window in Kile: that uses KParts and will NOT 
work in Fedora 9 because the KDE 3 KParts for DVI, PS and PDF are no longer 
available
3. standalone viewer: that should work, using xdg-open
Your error message for ViewDVI says that it's trying to use 2., which doesn't 
work. I'm not sure what's wrong with ViewPDF.
Comment 13 Kevin Kofler 2008-06-21 23:21:50 EDT
OK, I see where the problem is, quickpreview.cpp hardcodes the "Embedded 
Viewer" configuration instead of using the default. I'm patching this.
Comment 14 Kevin Kofler 2008-06-21 23:41:16 EDT
QuickPreview patched to use xdg-open instead of the embedded viewer.
F9 build here: http://koji.fedoraproject.org/koji/taskinfo?taskID=674671
Comment 15 Fedora Update System 2008-06-22 00:14:51 EDT
kile-2.0.1-2.fc9 has been submitted as an update for Fedora 9
Comment 16 Peeter Puusemp 2008-06-22 05:41:35 EDT
OK, I didn't read it out so well before. Now I see. At least it led to one small
bug. :)

Isn't it then better to enable the embedded preview in the bottom pane by
default as at the moment the default action is broken? Then also gray out
options that are broken in the configuration dialog...

You said the embedded preview in the bottom pane uses dvipng, but actually it
isn't installed as dependency. All, but math group embedded preview in the
bottom pane, works without dvipng and if to install dvipng package then the math
group check box in the configuration dialog gets also enabled and so math groups
can be previewed in the bottom pane too. So if you like the idea to make the
embedded preview in the bottom pane as default then it would be good to add
dvipng package as dependency.
Comment 17 Kevin Kofler 2008-06-22 12:49:22 EDT
I've just fixed the default action in 2.0.1-2.fc9, so there's no need to change 
the default.
Comment 18 Fedora Update System 2008-06-22 16:43:52 EDT
kile-2.0.1-2.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kile'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-5593
Comment 19 Peeter Puusemp 2008-06-23 06:50:36 EDT
(In reply to comment #17)
> I've just fixed the default action in 2.0.1-2.fc9, so there's no need to change 
> the default.

Sorry, yes. I didn't think about it so much with tired head and as I hadn't
tried the update I didn't realize that it was fixed and working.

After your post I downloaded the update from koji and there are no errors any
more. Thank you!

(Only one more remark. Maybe instead of forcing xdg-open, use the one that user
set in ViewPDF/ViewDVI in the configuration dialog. In Gnome the default PDF
opener is Evince, but for example I want that Kile uses Okular instead of
Evince. Therefore I have set ViewPDF to Okular instead of xdg-open.)
Comment 20 Kevin Kofler 2008-06-23 10:24:34 EDT
Well, previously Embedded Viewer was hardcoded, so it was easier to change it 
that way, I guess we could indeed look up the default though.

But you can change your file associations.
Comment 21 Peeter Puusemp 2008-06-23 11:13:42 EDT
Actually it is just so called eye-candy thing. So not very important.

Explanation:
---------
I use Okular as PDF file viewer in Kile when I review the whole document,
because it refreshes the file automatically when the pdf file has changed.

The quick preview feature uses xdg-open, it means the default viewer in the
desktop environment. It is Evince in GNOME. I don't want to change it to Okular
as I use GNOME and want to use otherwise GNOME applications.

Since one feature uses Okular and the other Evince then it is a little bit
cluttered now.
---------

It's just me of course, but I thought maybe some other people would like to use
custom one too.

But thanks for the fix!

With best wishes,
Peeter Puusemp
Comment 22 Rex Dieter 2008-06-23 11:18:58 EDT
Interesting, gnome/kde now share the same mime system, the "default" app should
be the same in both (in most cases).
Comment 23 Peeter Puusemp 2008-06-23 11:26:15 EDT
I set Okular myself in the configuration dialog. So I don't use the default one,
because of the reason I said before.


(ViewPDF --> Okular)
Comment 24 Rex Dieter 2008-06-23 11:34:04 EDT
regardless, imo, future changes/enhancements discussed here really need to
happen upstream, not here.
Comment 25 Peeter Puusemp 2008-06-23 12:06:30 EDT
(In reply to comment #24)
> regardless, imo, future changes/enhancements discussed here really need to
> happen upstream, not here.

My future comments were connected to the fix that Kevin Kofler made.

I report the whole problem upstream near future, since isn't it overall problem?
Comment 26 Rex Dieter 2008-06-23 12:21:04 EDT
yep
Comment 27 Fedora Update System 2008-06-24 22:51:07 EDT
kile-2.0.1-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 28 tdbtdb+bug 2009-02-04 17:42:59 EST
kile-2.0.3-1.fc9.x86_64 still has problem of kile can't find kdvi. Reproduced by choosing settings/system check.

As a newbie, wouldn't it be nice if there was an easy way to find the workaround rather than dredging through 27 comments?
Comment 29 Kevin Kofler 2009-02-04 17:50:47 EST
* Ignore the system check, just go with the default (xdg-open).
* Make sure you have at least one DVI viewer installed (kdegraphics (Okular), evince or xdvi).

Note You need to log in before you can comment on or make changes to this bug.