mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-02 14:14:10 +00:00
Print correct number of copies using new Qt api
Add eror code if print to file fails BUG: 155695 svn path=/trunk/KDE/kdegraphics/okular/; revision=1065863
This commit is contained in:
parent
c2390f3197
commit
ed9bbddace
|
@ -80,7 +80,11 @@ int FilePrinter::doPrintFiles( QPrinter &printer, QStringList fileList, FileDele
|
|||
|
||||
if ( inputFileInfo.suffix() == outputFileInfo.suffix() ) {
|
||||
int res = QFile::copy( fileList[0], printer.outputFileName() );
|
||||
if ( res ) ret = 0;
|
||||
if ( res ) {
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = -5;
|
||||
}
|
||||
} else if ( inputFileInfo.suffix() == "ps" && outputFileInfo.suffix() == "pdf" && ps2pdfAvailable() ) {
|
||||
exe = "ps2pdf";
|
||||
argList << fileList[0] << printer.outputFileName();
|
||||
|
@ -150,6 +154,7 @@ QList<int> FilePrinter::pageList( QPrinter &printer, int lastPage, const QList<i
|
|||
for (int i = startPage; i <= endPage; i++ ) {
|
||||
list << i;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -336,8 +341,7 @@ QStringList FilePrinter::destination( QPrinter &printer, const QString &version
|
|||
|
||||
QStringList FilePrinter::copies( QPrinter &printer, const QString &version )
|
||||
{
|
||||
// If CUPS will always return 1 regardless what the user chooses.
|
||||
int cp = printer.numCopies();
|
||||
int cp = printer.actualNumCopies();
|
||||
|
||||
if ( version == "lp" ) {
|
||||
return QStringList("-n") << QString("%1").arg( cp );
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
* -8 if empty file name
|
||||
* -7 if unable to find file
|
||||
* -6 if invalid printer state
|
||||
* -5 if print to file copy failed
|
||||
* -2 if the KProcess could not be started
|
||||
* -1 if the KProcess crashed
|
||||
* otherwise the KProcess exit code
|
||||
|
@ -87,6 +88,7 @@ public:
|
|||
* -8 if empty file list
|
||||
* -7 if unable to find a file
|
||||
* -6 if invalid printer state
|
||||
* -5 if print to file copy failed
|
||||
* -2 if the KProcess could not be started
|
||||
* -1 if the KProcess crashed
|
||||
* otherwise the KProcess exit code
|
||||
|
|
Loading…
Reference in a new issue