cannot disable preview of postscript files

Bug #62285 reported by Manuel López-Ibáñez
2
Affects Status Importance Assigned to Milestone
kdebase (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: konqueror

Steps to reproduce:

1. Open Konqueror.
2. Disable preview of Postscript, PDF and DVI files (View->Preview->Postscript,PDF and DVI files).
3. Reload a folder with PDF and PS files.
4. For PDF files, Konqueror now shows an icon, however, PS files are still previewed showing the PS code and not the PS rendered document.
5. Enable preview of Postscript, PDF and DVI files (View->Preview->Postscript,PDF and DVI files).
6. Both PDF and PS documents are previewed correctly.

Revision history for this message
Anthony Mercatante (tonio) wrote :

It makes sense since pstscript files are text files.
If you disable the ps preview but don't disable text preview, konqueror will preview the files as text files.
I don't see anything going wrong there.

Changed in kdebase:
status: Unconfirmed → Rejected
Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

No, they aren't. They are application/postscript. They are NOT text files.

By your same rule, PDF files are also text and thus, their code should be shown as well.

Changed in kdebase:
status: Rejected → Unconfirmed
Revision history for this message
Andreas Simon (andreas-w-simon) wrote :

As fas as I can tell this behaviour is intended by upstream. /usr/share/mimelnk/application/postscript.desktop
includes the lines

 [Property::X-KDE-text]
 Type=bool
 Value=true

which causes the descibed effect. Setting Value=false makes postscript files render as icon only, like PDF files.

I think this was done to make it easy in some apps (for example kate) to show and edit postscript as text. I remember years ago I needed to load postscript into text editors to do some changes (mostly bounding box stuff) quite often.

Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

What a hack! Couldn't just Kate handle application/postscript directly instead of needing to be "lied" about it?

Anyway, thanks Andreas, that is a sensible answer and I guess that this goes beyond Konqueror and it involves more complex MIME stuff.

Thus, you may reject the bug if you wish.

Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

Just a final note: why the same behaviour doesn't apply to EPS files? They are just postcript. Preview for EPS files is handled by the "Postscript, PDF and DVI" option (nor image, nor text).

Whatever...

Revision history for this message
Andreas Simon (andreas-w-simon) wrote :

Yes, it's a hack from the time when there was no real inheritance in the mime spec from freedesktop.org. KDE4 will use the new spec and this hack will no longer be needed.

KDE needed this in cases when there is no specific mime handler installed, but the mime type is (also) a text format, so that therefore a text editor can be started. So they added a way to tell that foo/bar is also text/plain. You find this also for example in all script types like application/x-python.

Anyway, you are right in that it's currently somewhat inconsistent. I dunno if it makes sense to add this to PDF too, I never heard of anyone editing a PDF with a text editor, contrary to PS, but at least encpsulated postscript should probably have this too.

Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

Funny, instead of being able to disable text preview for PS files, now I am going to get it also for EPS files. Well, I guess I was too quick reporting this ;-)

As I said, feel free to close/reject this.

Revision history for this message
Anthony Mercatante (tonio) wrote :

Thanks Andreas for the detailled explanation.
I'm rejecting this, since it is intended upstream.

Changed in kdebase:
status: Unconfirmed → Rejected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.