Bug 162793 - Qt handles real printers as local file
Summary: Qt handles real printers as local file
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unclassified
Component: qt (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal with 100 votes (vote)
Target Milestone: ---
Assignee: Thomas Zander
URL:
Keywords:
: 164363 164778 164835 166240 168370 170555 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-29 09:53 UTC by Frederik V
Modified: 2008-09-06 21:48 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik V 2008-05-29 09:53:59 UTC
Version:            (using Devel)
Installed from:    Compiled sources
OS:                Linux

See https://bugs.launchpad.net/ubuntu/+source/kdegraphics-kde4/+bug/234558

Okular on arch from KDEmod (Okular v0.6.80, Kde 4.0.80) lists the two printers at the end of the printer list as local file. They have a proper name, but printing results in printing to a pdf or postscript file (the file turns up) and not to the printer. There is no way to specify where the file should be.

Konqueror from the same KDE version lists all the three printers correctly and then separate entries for printing to pdf and ps.

Probably it's just the list that is wrong (not listing the pdf and ps options last), and the file entry field that is missing.
Comment 1 Pino Toscano 2008-05-29 10:42:35 UTC
This is indeed a Qt problem.

The bug is basically triggered by the fact Okular disables the QAbstractPrintDialog::PrintToFile option when printing using backends that don't support the printing to file.
Comment 2 John Layt 2008-05-29 23:29:22 UTC
I'm seeing a similar issue on OpenSuse 11 beta 3+ with Qt 4.4.0. It appears to me to be a Qt bug, I plan to confirm, patch, and file a bug report this weekend.

What I'm seeing is in all apps, even native Qt ones, that when QPrintDialog is displayed that while the first printer/item is selected/displayed in the combo box, the rest of the dialog is set up for the last printer/item, i.e. for the "Print To Postscript" printer, with the filename edit widget enabled.  Clicking OK tries to print to ps file.  Changing to another printer in the combo box fixes the problem.  

With Okular disabling the Print to File options, it half sets the dialog up for the Print To Postscript (so some QList<QPrinterInfo> iterator somewhere not getting reset after populating the combo?) but with the filename edit widget disabled, and printing fails.  If you only have one printer installed you can't switch printers to fix it.
Comment 3 John Layt 2008-05-30 00:17:30 UTC
Playing a little more, if I have 3 printers installed in Cups, everything works OK, which reminds me of some code I saw in QPrintDialog that does a -2 on the number of printers in the combo, I suspect it doesn't check if the Print To File options have been disabled.  I'll chase that down this weekend.
Comment 4 Pino Toscano 2008-05-30 00:51:48 UTC
I was able to create a very small Qt testcase, and sent it to qt-bugs.
Comment 5 Frederik V 2008-05-30 09:25:02 UTC
I don't see any differences when changing the printers with 3 printers installed (on kdemod/arch). The first of the 3 printers works, but the others are print to file anyway.
Comment 6 Luciano Leveroni 2008-06-06 20:32:08 UTC
I've the exactly the same experience as described by John Layt, so this is preventing me for using Okular to print documents :(

Hope this get fixed for the next bugfix qt 4.4 release :)
Comment 8 Pino Toscano 2008-06-18 11:06:58 UTC
*** Bug 164363 has been marked as a duplicate of this bug. ***
Comment 9 Modestas Vainius 2008-06-19 11:01:03 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 Christophe Giboudeaux 2008-06-23 21:09:11 UTC
*** Bug 164778 has been marked as a duplicate of this bug. ***
Comment 11 Pino Toscano 2008-06-24 17:18:05 UTC
*** Bug 164835 has been marked as a duplicate of this bug. ***
Comment 12 Ferdinand Gassauer 2008-06-28 08:06:22 UTC
So I hope KDE 4.1 will be based on QT 4.5 as this bug is a blocker for commercial environments 
Comment 13 Pino Toscano 2008-06-28 10:52:29 UTC
> So I hope KDE 4.1 will be based on QT 4.5 as this bug is a blocker for commercial environments

Ahahaha. Nice try.
Qt 4.4 was released no more than 2 months ago, so you won't see Qt 4.5 before other 6 months.
Oh, and changing priority for Qt bugs (especially when I asked for a quicker resolution of them) has no usefulness.
Comment 14 Felix Möller 2008-06-28 21:00:27 UTC
i have kpdf installed for printing :-(
Comment 15 Luciano Leveroni 2008-06-28 23:29:14 UTC
This bug force me to install Adobe Reader just to print! No print support in a PDF Viewer is CRITICAL. The fix does not seem to be complex at all, please fix this for 4.4.1.

Thanks!
Comment 16 Michal Borek 2008-06-29 11:13:44 UTC
Luciano, I had to do the same step, even though I like Okular.
Comment 17 Roman K. 2008-07-07 19:02:55 UTC
I can confirm this. I also installed adobe reader just to print pdf-files.
Comment 18 Pino Toscano 2008-07-10 17:45:31 UTC
*** Bug 166240 has been marked as a duplicate of this bug. ***
Comment 19 David Faure 2008-07-12 01:21:39 UTC
Fixed by qt-copy patch 0237, the fix will be in Qt-4.4.1 too.
Meanwhile I suggest patching your Qt with qt-copy/patches/0237-printdialog-assert.diff  
Comment 20 Alexander Minges 2008-07-13 16:07:58 UTC
Doesn't work here. The printer is shown correctly now, but it still doesn't print (printer is configured correctly, as I can print from Konqueror).
Comment 21 Frederik V 2008-07-13 21:07:43 UTC
Here too, and the pdf's are still appearing in my home folder. 
Comment 22 Thomas Zander 2008-07-17 18:28:14 UTC
Fixed upstream.
Comment 23 David Faure 2008-07-21 18:12:46 UTC
Thomas: does "fixed upstream" mean that you improved the code after patch 0237, given that people report it doesn't work with just that patch?
In that case, could you send me the second patch, so that we can have it in qt-copy? A fix in Qt's source code for the next release isn't enough for such a critical bug, we need to patch qt-copy asap to check that everything works now.
Thanks.
Comment 24 David Faure 2008-07-22 20:46:47 UTC
SVN commit 836672 by dfaure:

Patch by Thomas Zander to fix "[Bug 162793] Qt handles real printers as local file".
CCBUG: 162793
CCMAIL: kde-packager@kde.org


 M  +1 -2      patches/0237-printdialog-assert.diff  
 A             patches/0240-printdialog-print-into-real-printer.diff  
 M  +1 -1      patches/README  
 M  +6 -3      src/gui/dialogs/qprintdialog_unix.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=836672
Comment 25 Pino Toscano 2008-08-04 23:40:49 UTC
*** Bug 168370 has been marked as a duplicate of this bug. ***
Comment 26 Luke-Jr 2008-08-14 08:20:33 UTC
Why should printing to a file ever be unavailable anyway? The only "reason" I can see is DRM... :/
Comment 27 Pino Toscano 2008-09-06 21:48:25 UTC
*** Bug 170555 has been marked as a duplicate of this bug. ***