mirror of
https://invent.kde.org/graphics/okular
synced 2024-07-05 00:58:46 +00:00
Improve CUPS detection to always match Qt, including if remote CUPS server
svn path=/trunk/KDE/kdegraphics/okular/; revision=1088926
This commit is contained in:
parent
c69e872d87
commit
9122f0db26
|
@ -216,8 +216,18 @@ bool FilePrinter::pdf2psAvailable()
|
|||
|
||||
bool FilePrinter::cupsAvailable()
|
||||
{
|
||||
FilePrinter fp;
|
||||
return ( fp.detectCupsConfig() && fp.detectCupsService() );
|
||||
#ifdef Q_WS_X11
|
||||
// Ideally we would have access to the private Qt method
|
||||
// QCUPSSupport::cupsAvailable() to do this as it is very complex routine.
|
||||
// However, if CUPS is available then QPrinter::numCopies() will always return 1
|
||||
// whereas if CUPS is not available it will return the real number of copies.
|
||||
// This behaviour is guaranteed never to change, so we can use it as a reliable substitute.
|
||||
QPrinter testPrinter;
|
||||
testPrinter.setNumCopies( 2 );
|
||||
return ( testPrinter.numCopies() == 1 );
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool FilePrinter::detectCupsService()
|
||||
|
|
Loading…
Reference in New Issue
Block a user