From 4660c5011610b5d4cfab7f074a5ae761484ed908 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 12 Oct 2015 12:04:42 +0200 Subject: [pwgui] Revert using cupsTempFile2 - has issues when running backend --- CMakeLists.txt | 1 - src/pwgui/main.cpp | 6 ++---- 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 #include #include -#include #include #include #include @@ -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 } -- cgit v1.2.3-55-g7522