summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2015-10-12 12:04:42 +0200
committerSimon Rettberg2015-10-12 12:04:42 +0200
commit4660c5011610b5d4cfab7f074a5ae761484ed908 (patch)
tree85b5abaca54aa422a1ea40468fef2b6b869ea4a6
parentUpdate cmake file (diff)
downloadprintergui-4660c5011610b5d4cfab7f074a5ae761484ed908.tar.gz
printergui-4660c5011610b5d4cfab7f074a5ae761484ed908.tar.xz
printergui-4660c5011610b5d4cfab7f074a5ae761484ed908.zip
[pwgui] Revert using cupsTempFile2 - has issues when running backend
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/pwgui/main.cpp6
2 files changed, 2 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1034227..4d9b9cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,7 +135,6 @@ TARGET_LINK_LIBRARIES(printergui
TARGET_LINK_LIBRARIES(printpwgui
${QT_LIBRARIES}
- ${CUPS_LIBRARIES}
)
# install
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp
index 67f53e8..256dca3 100644
--- a/src/pwgui/main.cpp
+++ b/src/pwgui/main.cpp
@@ -6,7 +6,6 @@
#include <QDesktopWidget>
#include <QLayout>
#include <cups/backend.h>
-#include <cups/cups.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <time.h>
@@ -111,9 +110,7 @@ int main(int argc, char *argv[])
// Get document to print
if (argc == 6) {
// Data comes from stdin, save...
- if (cupsTempFile2(tmpfile, NAMELEN) == NULL) {
- snprintf(tmpfile, NAMELEN, "/tmp/print-%s-%d-%s-%d", argv[1], (int)time(NULL), argv[2], (int)getpid());
- }
+ snprintf(tmpfile, NAMELEN, "/tmp/print-%s-%d-%s-%d", argv[1], (int)time(NULL), argv[2], (int)getpid());
int fh = open(tmpfile, O_CREAT | O_WRONLY | O_TRUNC, 0600);
if (fh < 0) {
helper_messageBox("PrinterGUI", "Konnte temporäre Datei für den Druckjob nicht anlegen.");
@@ -165,6 +162,7 @@ int main(int argc, char *argv[])
spoolres = run_backend(backend, device, argv[1], argv[2], argv[3], argv[4], argv[5], tmpfile, NULL);
helper_killGui();
if (spoolres != CUPS_BACKEND_AUTH_REQUIRED) {
+ remove(tmpfile);
return helper_cupsError(spoolres); // Yay
}