From ed9bbddacee29d5048e41c2761586e80e6a91989 Mon Sep 17 00:00:00 2001 From: John Layt Date: Thu, 24 Dec 2009 14:39:49 +0000 Subject: [PATCH] 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 --- core/fileprinter.cpp | 10 +++++++--- core/fileprinter.h | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/fileprinter.cpp b/core/fileprinter.cpp index cbcec8949..e8d28303a 100644 --- a/core/fileprinter.cpp +++ b/core/fileprinter.cpp @@ -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 FilePrinter::pageList( QPrinter &printer, int lastPage, const QList