Bug 59226 - some Qt apps (e.g., Opera dynamic) cannot print
Summary: some Qt apps (e.g., Opera dynamic) cannot print
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: qt (Show other bugs)
(Show other bugs)
Version: 7.2
Hardware: i386 Linux
Target Milestone: ---
Assignee: Ngo Than
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2002-02-03 01:50 UTC by Need Real Name
Modified: 2007-04-18 16:39 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-09-25 20:20:32 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Need Real Name 2002-02-03 01:50:07 UTC
Description of Problem:

At least some Qt apps (specifically, Opera) cannot print if dynamically
linked against Qt under Red Hat 7.2.  The print dialogs show erroneous
printer names, and print attempts silently fail.  Here's a description from
a user running into this problem:  
Version-Release number of selected component (if applicable):


How Reproducible:

Every time.

Steps to Reproduce:
1. Install Opera 5.05 dynamic (opera-5.05_tp1-6-shared_qt-libnpp-0.1.1-rh71.x86.rpm)

2. Go to a web page, then print using File->Print...

Actual Results:

The print dialog box shows strangely named printers (e.g., "lp:ml").
Print attempts fail silently, without queuing the print jobs.

Expected Results:

The print dialog box should show correctly named printers (e.g., "lp").
The print attempts should succeed in queuing the print jobs.

Additional Information:

I strace'd opera and found that /usr/bin/lp was being invoked with a bad
printer destination (eg., '-dlp::ml' instead of '-dlp').  
I installed qt-2.3.1-5.src.rpm and looked through the code.  It appears to
me that the qt-2.3.1-LPRng.patch is incorrect:  
--- qt-2.3.1/src/dialogs/qprintdialog.cpp.lprng Wed Jun 13 10:53:46 2001  
+++ qt-2.3.1/src/dialogs/qprintdialog.cpp       Sat Jun 16 09:50:58 2001  
@@ -158,7 +158,11 @@  
             QString printerName, printerComment, printerHost;  
             if ( i >= 0 ) {  
                 // have : want |  
-                int j = printerDesc.find( '|' );  
+                               // LPRng allows additional stuff like "lp=|/usr/share/printconf/something  
+                               // --> handle "=" like "|"  
+                               int j = printerDesc.find( '=' );  
+                               if( j == -1 )  
+                                   j = printerDesc.find( '|' );  
                 printerName = printerDesc.left( j > 0 ? j : i );  
                 if ( j > 0 ) {  
                     // try extracting a comment from the aliases...  
The printerDesc.find( '=' ) call is finding the '=' from the following capability assignment.  The code then incorrectly decides that everything before the '=' is the printer name.  
So a printcap entry like:  
would be interpreted as having the printer name 'lp:ml'.  
I commented out the qt-2.3.1-LPRng.patch patch in the qt.spec file and built a new qt rpm.  After installing that new qt package, Opera printed as expected: the printer names are correct, and print jobs successfully queue.

Comment 1 Ngo Than 2002-10-21 15:16:00 UTC
It's fixed in 7.3 or 8.0 release. If someone wants qt-2.3.2 including this fix,
please let me know. I will build it and copy on people.redhat.com

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