diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | 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 <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 } |