Bug 137425 - kdeprint:default preview program not found
Summary: kdeprint:default preview program not found
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kdeprint
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KDEPrint Devel Mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-15 21:01 UTC by Toralf Förster
Modified: 2011-03-09 11:16 UTC (History)
1 user (show)

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


Attachments
ps file association (95.04 KB, image/png)
2006-11-16 11:37 UTC, Toralf Förster
Details
ps file association emb (96.28 KB, image/png)
2006-11-16 11:37 UTC, Toralf Förster
Details
kdeprint config (45.68 KB, image/png)
2006-11-16 11:38 UTC, Toralf Förster
Details
error msg (14.06 KB, image/png)
2006-11-16 11:39 UTC, Toralf Förster
Details
error msg german (16.77 KB, image/png)
2006-11-16 12:35 UTC, Toralf Förster
Details
fix wrong service returned (427 bytes, patch)
2006-11-21 04:28 UTC, Cristian Tibirna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster 2006-11-15 21:01:06 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          gcc-3.4.6 
OS:                Linux

I have installed a modular kde-3.5.5 under a stable Gentoo with a minimal set of packages and CUPS as the printing system. I haven't installed kghostview but kpdf.

Using the preview function from kdeprint I got the error "program kuick  not found". Therefore I configured kdeprint to use the external kpdf program whic hworks fine.

But I'm wondering where I could find kuick. Until now I did not found a package containing kuick. And kdeprint coul dlook for kpdf itself, isn't it ?
Comment 1 Michael Goffioul 2006-11-16 09:12:53 UTC
kdeprint uses by default the program that is registered to view (embedded) postscript files. Check your file association to see which application is registered.
Comment 2 Toralf Förster 2006-11-16 09:28:59 UTC
Before I specified the external program kpdf, the help text of that appripriate kdeprint window stated out that the internal program (kghostview) is used. I'm wondering why the error msg than said 'kuick not found', b/c I didn't configured kuick.
Comment 3 Michael Goffioul 2006-11-16 09:36:01 UTC
Could you still check your KDE file association for postscript file, and also maybe report a screenshot of the error dialog you got when kpdf was not specified as print previewer?
Comment 4 Toralf Förster 2006-11-16 11:37:37 UTC
Created attachment 18580 [details]
ps file association
Comment 5 Toralf Förster 2006-11-16 11:37:58 UTC
Created attachment 18581 [details]
ps file association emb
Comment 6 Toralf Förster 2006-11-16 11:38:40 UTC
Created attachment 18582 [details]
kdeprint config
Comment 7 Toralf Förster 2006-11-16 11:39:02 UTC
Created attachment 18583 [details]
error msg
Comment 8 Michael Goffioul 2006-11-16 12:02:06 UTC
These screenshots does not mention "kuick"...
Comment 9 Toralf Förster 2006-11-16 12:35:05 UTC
Created attachment 18584 [details]
error msg german

Right, "kuick" seems to be appear only for German environment, but the english
message seems to be mysterious too, isn't it ?

BTW, in the config screenshot there's now the greyed out string "kpdf".
Immediately after the installation I read there "gv".
Comment 10 Michael Goffioul 2006-11-16 13:26:02 UTC
"Kuick - Kopieren und Verschieben" is a description string corresponsing to some installed (KDE) program (but I don't know which one). Normally, as you don't have any PS viewer registered, what you should get is a dialog telling there's no viewer associated with PS. But this does not work for you. I wonder to which program "Kuick - ..." or "Compress/Extract" description strings are associated.

I'm not running Linux, so I cannot help much further (I hope Cristian will). What you can do is trying to find to which services the strings above are associated. What could also help is to see what is the actual type of the file kdeprint is trying to preview. To do this, you can look for a file named kdeprint_XXXXXX (XXXXXX being a random string) in the KDE temporary directory (usually ~/.kde/tmp or similar) when the error dialog is active. This temp file should stay there as long as the dialog is shown. Once you found that file, check its content (for instance with "file").
Comment 11 Cristian Tibirna 2006-11-16 13:27:31 UTC
If the KDE you compile is from Gentoo packages, one should look at the sources of these packages and see what patches are applied to them, compared to the official KDE sources.

As Michael explains, KDEPrint uses the standard KDE selection mechanisms for the ps viewer. If these mechanisms are misconfigured in Gentoo (e.g. .desktop files missing, .desktop files misinstalled, autodetection of "supported" non-kde programs disabled), then you can end up with an empty ps-viewing association list and eventually end up with such a non-functional/weird behavior. Please, if you care, check the patching of the gentoo KDE packages. These problems that you report, didn't seem to appear in other distros.

Thanks
Comment 12 Toralf Förster 2006-11-16 17:01:28 UTC
ok, the temp file is PS:

tfoerste@n22 ~ $ head /tmp/kde-tfoerste/kdeprint_lBCQHlaL
%!PS-Adobe-1.0
%%BoundingBox: 0 0 595 841
%%Creator: Qt 3.3.6
%%Title: model.xml
%%CreationDate: Thu Nov 16 16:58:33 2006
%%Orientation: Portrait
%%Pages: 10
%%DocumentFonts: ArialMT CourierNewPSMT CourierNewPS-BoldMT

%%EndComments

I'll propably open a bug at bugs.gentoo.org
Comment 13 Michael Goffioul 2006-11-17 09:19:59 UTC
OK, so it's really postscript, and it's probably detected as such by KDE. There's really a problem in your configuration related to the services/application and the file association. With a correct configuration, you should get another error message as I stated in comment #10. At this point, it's difficult to help you without tracking the code line by line.

Something that might help is trying to find to which services "Kuick - ..." or "Compress/Extract" corresponds. You can do it by scanning the .desktop file from your KDE installation directory:

find /where/kde/is/installed -name "*.desktop" | xargs grep Kuick

or

find /where/kde/is/installed -name "*.desktop" | xargs grep "Compress/Extract"
Comment 14 Toralf Förster 2006-11-17 10:37:32 UTC
yes, as I stated out in https://bugs.gentoo.org/show_bug.cgi?id=155365 I found the string kuick here :
tfoerste@n22 /usr/kde/3.5/share $ grep -Hir kuick *
...
applnk/.hidden/kuickplugin.desktop:Name[de]=Kuick - Kopieren und Verschieben
Comment 15 Michael Goffioul 2006-11-17 11:22:06 UTC
This seems to be a service that is able to handle any mimetype, but it is not, as such, a viewer. Maybe the problem is in kdeprint in the end. It's been a long time since I programmed KDE, but Cristian, could you check whether it's normal that KServiceTypeProfile::preferredService() (kdelibs/kdeprint/kprintpreview.cpp) returns a non-Application entry, while it shouldn't? (info extracted from API doc, so I might be wrong)

Note that code has changed in CVS (future 4.0 release), so the problem might have disappeared already.
Comment 16 Toralf Förster 2006-11-17 11:46:18 UTC
BTW, I defined now KPDF within the control center as default viewer for postscript and now I didn't have the problem with the previewer.
But the question, why there wasn't a default before.
Comment 17 Michael Goffioul 2006-11-17 12:07:28 UTC
Because KPDF didn't register itself as postscript viewer. Usually, it's kghostview.
Comment 18 Cristian Tibirna 2006-11-20 04:31:11 UTC
Well, Michael, regarding your comment #15, I'm not sure how to interpret the code around line 285 in kprintpreview.cpp, but that call, KServiceTypeProfile::preferredService() was introduced with a QString::null as second argument since the beginning (SVN revision 137056: http://websvn.kde.org/trunk/kdelibs/kdeprint/kprintpreview.cpp?rev=137056&r1=136981&r2=137056)

So, if only applications should be selected by this call, we should have "Application" instead of QString::null there.

I didn't have time to investigate KServiceType, but I think there should be "Application" instead QString::null.
Comment 19 Cristian Tibirna 2006-11-20 05:46:34 UTC
And still, I think this could be rather a Gentoo issue than a KDEPrint issue, but we would eventually need a safeguard. How come nobody experienced such problems until now?
Comment 20 Michael Goffioul 2006-11-20 09:15:20 UTC
From the documentation, using QString::null is equivalent to "Application". So switching to "Application" shouldn't make any difference. But it's difficult to say where the problem is without debugging.

Moreover I see in SVN that the code has changed and that kuick_plugin .desktop has disappeared.

Maybe this kind of problem never popped up because everybody had kghostview installed? One test case could be to remove all .ps file association (embedded and non-embedded) and see what happens. I still have no running Linux box available so I can't really help, sorry.
Comment 21 Cristian Tibirna 2006-11-21 04:28:54 UTC
Created attachment 18636 [details]
fix wrong service returned

Would you have a means to please test this patch and see if it corrects the
problem? (with this, kdeprint should at least announce you that you don't have
a known ps viewer installed).

Thanks
Comment 22 Kurt Pfeifle 2007-01-09 17:47:36 UTC
For now I don't have source code or a machine to compile on, but hopefully before the end of January I can test this patch.

Toralf, 
Gentoo users usually are faster with testing patches  :-P
Have you had a chance to do so yet? (It's only 1 word in 1 line that changes)
Comment 23 Carsten Lohrke 2007-04-06 01:50:26 UTC
The patch doesn't change anything. After uninstalling KGhostview, it is Karbon providing application/postscript via its kpart and import desktop entries on my box.


kdeprint: kdeprint: querying trader for 'application/postscript' service
kio (KTrader): KServiceTypeProfile::offers serviceType=application/postscript genericServiceType=KParts/ReadOnlyPart
kio (KTrader): query for application/postscript, KParts/ReadOnlyPart : returning 2 offers
kio (KTrader): query for Karbon/CoreModule : returning 3 offers
kdeprint: kdeprint: creating preview dialog
koffice (lib kofficecore): creating KoBrowserExtension
kdecore (KAction): WARNING: KAction::plugAccel(): call to deprecated action.
koffice (lib kofficecore): KoDocument::openURL url=file:///home/carsten/.kde3.5/tmp-iglu/kpdfquHPfc.ps
koffice (lib kofficecore): karbonpart.desktop found.
koffice (lib kofficecore): KoDocument::openFile /home/carsten/.kde3.5/tmp-iglu/kpdfquHPfc.ps type:application/postscript
kio (KTrader): query for KOfficePart : returning 18 offers
koffice (filter manager): KoFilterEntry::query(  )
kio (KTrader): query for KOfficeFilter : returning 90 offers
koffice (filter manager): Filter: KOffice XSLT-Exportfilter doesn't apply.
parsing started
size is 4
parsing finished
command to execute is (gs -q -P- -dBATCH -dNOPAUSE -dSAFER -dPARANOIDSAFER -dNODISPLAY ps2ai.ps '/home/carsten/.kde3.5/tmp-iglu/kpdfzkw9na.ps' | sed -e "s/%%BoundingBox: 0 0 612 792/%%BoundingBox: 0 0 595 842/g" > '/home/carsten/.kde3.5/tmp-iglu/kpdfpqP7Ja.tmp')
unknown operator: Adobe_packedarray
pushing Adobe_packedarray to stack
unknown operator: Adobe_cmykcolor
pushing Adobe_cmykcolor to stack
unknown operator: Adobe_cshow
pushing Adobe_cshow to stack
unknown operator: Adobe_customcolor
pushing Adobe_customcolor to stack
unknown operator: Adobe_typography_AI3
pushing Adobe_typography_AI3 to stack
unknown operator: Adobe_IllustratorA_AI3
pushing Adobe_IllustratorA_AI3 to stack
unknown operator: To
pushing To to stack
unknown operator: Tp
pushing Tp to stack
unknown operator: TP
pushing TP to stack
unknown operator: Tr
pushing Tr to stack
state integer / start char H (72)
parsing aborted
kparts: Part::~Part 0x83f7fb0
kparts: deleting widget [QWidget pointer (0x83f8918) to widget gvpart, geometry=833x1+0+328] gvpart


I was greeted with the message dialog
 
Öffnen dieser Datei nicht möglich
/home/carsten/.kde3.5/tmp-iglu/kpdfGnEX4a.ps.
Ursache: Erstellungsfehler

(in english: Can't open file - /... - reason: creation error)
 
and afterwards the expected print preview dialog showed up, but in complete gray and only with the close button visible.


You ask for a service, so you get one - well, sort of.

User defined previewer -> hardcoded KGhostview -> error message would be a possible fix, ignoring any associated application.
Comment 24 Nathaniel Taylor 2007-06-27 02:01:55 UTC
I had exactly the problem of #23, and I'm also using Gentoo's kde-3.5.4, with 
a kde config dir that's been around a bit.

Thanks to the hints above, I've fixed it, for me, simply by changing the order of embedded viewers in the konqueror configuration -- 'karbonpart' was initially above kghostview, perhaps due to a gentoo oversight or some earlier change that I've made.  

So, for others to try:  konqueror -> settings -> configure konqueror -> file associations -> application -> postscript , then the "Embedding" tab, and make sure that KGhostView is at the top.
Finally, after months of putting it off, this is fixed.  

I've tried it from a new user's account, and THE PROBLEM WASN'T THERE.
I must have made some change in the past that assisted the problem.  
It seems to be only gentoo people who've had it, but perhaps that was
chance?
Comment 25 Dann 2009-01-13 03:52:28 UTC
I use KDE 4.1.3 and Okular to view pdfs and ps files. 
I get the exact same error message!

I recently fixed it; to do so, go to the Print dialog, choose the System Options button, go to the Preview icon on the left side, check mark the "Use External Program" and search for okular (/usr/bin/okular) or whatever program you use to view ps files. 

You guys helped a bunch, this was really frustrating me. Cheers. 
:)