summaryrefslogtreecommitdiffstats
path: root/src/pwgui/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pwgui/main.cpp')
-rw-r--r--src/pwgui/main.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp
index edd594c..5dd5a07 100644
--- a/src/pwgui/main.cpp
+++ b/src/pwgui/main.cpp
@@ -282,13 +282,21 @@ static int run_backend(char *backend, char *uri, char *jobid, char *user, char *
}
}
setenv("DEVICE_URI", uri, 1);
- ERROR("DEVICE_URI: '%s'", uri);
+
char *args[8];
args[0] = uri;
args[1] = jobid;
args[2] = user;
- args[3] = title;
+ // Fix job title if possible
+ if (strncmp(title, "gui-", 4) == 0) {
+ args[3] = strchr(title, ' ');
+ if (args[3] == NULL) {
+ args[3] = title;
+ }
+ } else {
+ args[3] = title;
+ }
args[4] = copies;
args[5] = options;
args[6] = file;
@@ -316,7 +324,7 @@ static int run_backend(char *backend, char *uri, char *jobid, char *user, char *
if (strstr(buffer, "Unable to get printer status (Unauthorized)") != NULL) {
needAuth = true;
if (kill(pid, SIGTERM) < 0) {
- ERROR("Sending SIGTERM to backend %d failed: %d\n", (int)pid, errno);
+ ERROR("Sending SIGTERM to backend %d failed: %d\n", (int)pid, (int)errno);
}
break;
} else if (strstr(buffer, "Destination printer does not exist") != NULL) {