Summary: | Preview in a GNOME desktop causes invalid "text/plain" MIME-TYPE request for evince | ||
---|---|---|---|
Product: | [Unmaintained] kdeprint | Reporter: | Philip Van Hoof <pvanhoof> |
Component: | general | Assignee: | KDEPrint Devel Mailinglist <kde-print-devel> |
Status: | CLOSED NOT A BUG | ||
Severity: | normal | CC: | jlayt |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Attached |
Description
Philip Van Hoof
2006-04-11 11:38:05 UTC
I don't really know in depth the architecture of KDE. So perhaps this is important (imho it shouldn't be but I don't know): The application I was trying was called umbrello. This is a UML diagram editor and code generator suite. I basically tried printing a class diagram. Oh and ... I'm not interested in fully switching to a KDE desktop just to fix this bug. ;-). It would be nice if applications just worked on whatever preferred desktop environment I choose. Does it happen also with other KDE applications? When you open the printer properties dialog and go to the "Filters" tab, do you see any filter enabled? Could you try to print to a PS file (without preview) and then view the result with evince? Michael. Writing to a .ps file does work (and evince can show it). It happens with all applications (I also tested kedit, which looks to me as a very typical application that can print). I don't see any filters enabled. I can post some screenshots if you want? Please let me know. The exact error message in evince is ->Unhandled MIME type: 'text/plain'<- Writing to a PDF file also works. Michael, Cristian: how does kdeprint know to find the preview application? Does it search for the application/postscript handler? I also thought it required a KPart for that... Philip: what are your file associations for application/postscript? (You'll have to open Konqueror, Settings, Configure Konqueror, File Associations) What happens if you take a PostScript file, rename it so it doesn't end in .ps and try to open it in evince? Local testing here indicates KDEPrint loads a KPart, so I have no idea how it is possible to get evince loaded... Actually, an external viewer can be started by kdeprint if: 1) no PS viewer component (KParts) could be loaded 2) an external preview program has been specified in the kdeprint settings The preview component searching involves: 1) detect mimetype of the file to preview 2) if PS 2a) using KTrader, looking for KParts/ReadOnlyPart that handle application/postscript 2b) look for libkghostviewpart 3) using KServiceTypeProfile::preferredService, look for a PS viewe app What would be interesting is to catch the file that evince is trying to view and check if it's correct PS or not. This file exists as long as the preview is not closed. If the error message from evince doesn't tell which file it's viewing, you should be able to find it somewhere in the KDE temporary directory. This temp dir might depend on your settings, but look in /tmp/kde-xxxxx/ or ~/.kde/tmp. The kdeprint temporary file has the name kdeprint.XXXXXXX. If you find it, please post it to the bug report. Michael. Created attachment 15584 [details]
Attached
If I rename that file to "kdeprint_xh2Tysak.ps" it does work.
It looks like the PS is OK. I can view it here with ghostview (under Windows). I don't get why evince isn't able to view it... When you mention that you renamed the file, do you mean that evince cannot view it if the filename doesn't end with ".ps"? Michael. Michael, that is correct. I don't know whether or not evince should. I'm guessing it should. As far as I could see on the web, evince is a multi-purpose viewer (PS, PDF, DVI...). IMO, it should be able to detect the file type correctly, whatever the filename (except if the filename uses a well-known extension, but it's not the case here). I don't want to start a flamewar, but I'm tempted to say that in this specific case, it's evince's fault. The only thing do-able at kdeprint-level is to use temporary filenames ending with ".ps". However, this would assume that kdeprint *always* generate PS, which is not automatically the case (if you use filters, for instance). I doubt this would ever be implemented in kdeprint. Maybe you should report the problem to evince's developers. Michael. Added a gnome-bug on gnome-vfs about this issue (after some discussion with some other gnome developers, we think this is a gnome-vfs issue): http://bugzilla.gnome.org/show_bug.cgi?id=338228 Let's solve this one ;-) Let's close this one then. If it appears there's still a problem with kdeprint, please re-open it. Michael: how does KDEPrint know to load the PostScript viewer if it can't tell whether its output is PS or not? It does not load a PS viewer, but loads a viewer component that is registered to view the preview file, which is determined at run-time. It's usually PS, but it could be something else: if the preview file is PNG and there's a PNG viewer component, it will be used instead. The only additional trick is when the preview file is PS and the default PS viewer component could not be loaded, then kdeprint tries to load libkghostviewpart directly. All the logic is the file kdelibs/kdeprint/kprintpreview.cpp. Michael. Closing old Resolved status bug. |