Bug 230814 - [KDE4] Improve CUPS detection in KCupsOptionsWidget
Summary: [KDE4] Improve CUPS detection in KCupsOptionsWidget
Status: RESOLVED FIXED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-15 11:27 UTC by Stefan Kiesler
Modified: 2010-03-15 12:46 UTC (History)
0 users

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 Stefan Kiesler 2010-03-15 11:27:08 UTC
Version:            (using KDE 4.3.5)
Compiler:          gcc 4.3.4 
OS:                Linux
Installed from:    Gentoo Packages

Important options are missing from the KDE4 print dialog when using a remote CUPS server instead of a local printer.
KCupsOptionsWidget::cupsAvailable() only checks for a running socket on localhost:631, instead it should respect the client CUPS configuration and poll the configured server (localhost or remote).

Here's the current (as of KDE 4.3.5) snippet of cupsAvailable() in /kdeui/dialogs/kcupsoptionswidget_p.cpp:

bool KCupsOptionsWidget::cupsAvailable() 
{ 
    // Ideally we would have access to the private Qt method 
    // QCUPSSupport::cupsAvailable() to do this as it is very complex routine, 
    // instead just take the simplest case of if we can connect to port 631 
    // then assume CUPS must be running and used by Qt. 
    QTcpSocket qsock; 
    qsock.connectToHost("localhost", 631); 
    bool rtn = qsock.waitForConnected() && qsock.isValid(); 
    qsock.abort(); 
    return rtn; 
}
Comment 1 Stefan Kiesler 2010-03-15 12:46:04 UTC
Never mind, just got a hint on the Gentoo forums that this bug is already resolved in trunk:

http://websvn.kde.org/trunk/KDE/kdelibs/kdeui/dialogs/kcupsoptionswidget_p.cpp?view=log

Sorry!