Commit b95ce71b authored by Marek Kasik's avatar Marek Kasik Committed by Matthias Clasen

printing: Fail nicely when /tmp is not writable

Don't crash when /tmp is not writable when printing to file.
Show that getting of printer details failed for CUPS printers.

https://bugzilla.gnome.org/show_bug.cgi?id=693200
parent 36930455
...@@ -473,7 +473,7 @@ gtk_print_job_get_surface (GtkPrintJob *job, ...@@ -473,7 +473,7 @@ gtk_print_job_get_surface (GtkPrintJob *job,
GError **error) GError **error)
{ {
GtkPrintJobPrivate *priv; GtkPrintJobPrivate *priv;
gchar *filename; gchar *filename = NULL;
gdouble width, height; gdouble width, height;
GtkPaperSize *paper_size; GtkPaperSize *paper_size;
int fd; int fd;
......
...@@ -135,8 +135,9 @@ op_unix_free (GtkPrintOperationUnix *op_unix) ...@@ -135,8 +135,9 @@ op_unix_free (GtkPrintOperationUnix *op_unix)
{ {
if (op_unix->job) if (op_unix->job)
{ {
g_signal_handler_disconnect (op_unix->job, if (op_unix->job_status_changed_tag > 0)
op_unix->job_status_changed_tag); g_signal_handler_disconnect (op_unix->job,
op_unix->job_status_changed_tag);
g_object_unref (op_unix->job); g_object_unref (op_unix->job);
} }
......
...@@ -2044,12 +2044,12 @@ selected_printer_changed (GtkTreeSelection *selection, ...@@ -2044,12 +2044,12 @@ selected_printer_changed (GtkTreeSelection *selection,
G_CALLBACK (printer_details_acquired), dialog); G_CALLBACK (printer_details_acquired), dialog);
/* take the reference */ /* take the reference */
priv->request_details_printer = printer; priv->request_details_printer = printer;
gtk_printer_request_details (printer);
set_busy_cursor (dialog, TRUE); set_busy_cursor (dialog, TRUE);
gtk_list_store_set (GTK_LIST_STORE (priv->printer_list), gtk_list_store_set (GTK_LIST_STORE (priv->printer_list),
g_object_get_data (G_OBJECT (printer), "gtk-print-tree-iter"), g_object_get_data (G_OBJECT (printer), "gtk-print-tree-iter"),
PRINTER_LIST_COL_STATE, _("Getting printer information…"), PRINTER_LIST_COL_STATE, _("Getting printer information…"),
-1); -1);
gtk_printer_request_details (printer);
return; return;
} }
......
...@@ -3489,7 +3489,7 @@ cups_request_ppd (GtkPrinter *printer) ...@@ -3489,7 +3489,7 @@ cups_request_ppd (GtkPrinter *printer)
GtkPrintBackend *print_backend; GtkPrintBackend *print_backend;
GtkPrinterCups *cups_printer; GtkPrinterCups *cups_printer;
GtkCupsRequest *request; GtkCupsRequest *request;
char *ppd_filename; char *ppd_filename = NULL;
gchar *resource; gchar *resource;
http_t *http; http_t *http;
GetPPDData *data; GetPPDData *data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment