[Xfce4-commits] r22662 - in xfprint/trunk: . libxfprint printing-systems/bsd-lpr printing-systems/cups xfprint

Jean-François Wauthy pollux at xfce.org
Fri Aug 4 22:17:11 UTC 2006


Author: pollux
Date: 2006-08-04 22:17:10 +0000 (Fri, 04 Aug 2006)
New Revision: 22662

Modified:
   xfprint/trunk/NEWS
   xfprint/trunk/libxfprint/printing-system.c
   xfprint/trunk/libxfprint/printing-system.h
   xfprint/trunk/printing-systems/bsd-lpr/bsdlpr.c
   xfprint/trunk/printing-systems/cups/cups.c
   xfprint/trunk/xfprint/print_dialog.c
Log:
Prevent xfprint4 from removing the printed file when the filters aren't applied

Modified: xfprint/trunk/NEWS
===================================================================
--- xfprint/trunk/NEWS	2006-08-04 21:16:44 UTC (rev 22661)
+++ xfprint/trunk/NEWS	2006-08-04 22:17:10 UTC (rev 22662)
@@ -1,11 +1,14 @@
 NEWS for xfprint
 ================
 
+4.3.x
+=====
+- Prevent xfprint4 from removing the printed file when the filters aren't applied
+
 4.3.90.2
 ========
+- Use GtkIconTheme instead of deprecated XfceIconTheme
 
-- use GtkIconTheme instead of deprecated XfceIconTheme
-
 4.3.90.1
 ========
 - Remove the a2ps dependency now it looks for it at runtime

Modified: xfprint/trunk/libxfprint/printing-system.c
===================================================================
--- xfprint/trunk/libxfprint/printing-system.c	2006-08-04 21:16:44 UTC (rev 22661)
+++ xfprint/trunk/libxfprint/printing-system.c	2006-08-04 22:17:10 UTC (rev 22662)
@@ -46,13 +46,13 @@
 
   GList *(*ps_get_printers) (void);
   Printer *(*ps_get_default_printer) (void);
-    gint (*ps_get_printer_state) (const gchar * printer);
-    gint (*ps_get_printer_jobs_count) (const gchar * printer);
+  gint (*ps_get_printer_state) (const gchar * printer);
+  gint (*ps_get_printer_jobs_count) (const gchar * printer);
 
-    gboolean (*ps_remove_job) (const gchar * printer, gint id);
+  gboolean (*ps_remove_job) (const gchar * printer, gint id);
   GList *(*ps_get_jobs) (const gchar * printer);
 
-    gboolean (*ps_print_file) (const gchar * printer, const gchar * original_name, const gchar * file);
+  gboolean (*ps_print_file) (const gchar * printer, const gchar * original_name, const gchar * file, gboolean remove_file);
 
   void (*ps_customize_printer_list_window) (PrinterListWindow * win);
   void (*ps_customize_printer_queue_window) (PrinterQueueWindow * win);
@@ -319,11 +319,11 @@
 }
 
 gboolean
-printing_system_print_file (PrintingSystem * ps, const gchar * printer, const gchar * original_name, const gchar * file)
+printing_system_print_file (PrintingSystem * ps, const gchar * printer, const gchar * original_name, const gchar * file, gboolean remove_file)
 {
   g_return_val_if_fail (ps, FALSE);
 
-  return PRINTING_SYSTEM_GET_PRIVATE (ps)->ps_print_file (printer, original_name, file);
+  return PRINTING_SYSTEM_GET_PRIVATE (ps)->ps_print_file (printer, original_name, file, remove_file);
 }
 
 void

Modified: xfprint/trunk/libxfprint/printing-system.h
===================================================================
--- xfprint/trunk/libxfprint/printing-system.h	2006-08-04 21:16:44 UTC (rev 22661)
+++ xfprint/trunk/libxfprint/printing-system.h	2006-08-04 22:17:10 UTC (rev 22662)
@@ -93,7 +93,7 @@
 GList *printing_system_get_jobs (PrintingSystem * ps, const gchar * printer);
 
 gboolean printing_system_print_file (PrintingSystem * ps, const gchar * printer, const gchar * original_name,
-                                     const gchar * file);
+                                     const gchar * file, gboolean remove_file);
 
 void printing_system_customize_printer_list_window (PrintingSystem * ps, PrinterListWindow * win);
 void printing_system_customize_printer_queue_window (PrintingSystem * ps, PrinterQueueWindow * win);

Modified: xfprint/trunk/printing-systems/bsd-lpr/bsdlpr.c
===================================================================
--- xfprint/trunk/printing-systems/bsd-lpr/bsdlpr.c	2006-08-04 21:16:44 UTC (rev 22661)
+++ xfprint/trunk/printing-systems/bsd-lpr/bsdlpr.c	2006-08-04 22:17:10 UTC (rev 22662)
@@ -248,7 +248,7 @@
 }
 
 G_MODULE_EXPORT gboolean
-print_file (const gchar * printer, const gchar * original_name, const gchar * file)
+print_file (const gchar * printer, const gchar * original_name, const gchar * file, gboolean remove_file)
 {
   gchar *cmd = NULL;
   gchar *base_name = NULL;
@@ -259,7 +259,8 @@
   cmd = g_strdup_printf ("lpr -P%s -T %s %s", printer, base_name, file);
   ret = xfce_exec_sync (cmd, FALSE, FALSE, NULL);
 
-  unlink (file);
+  if (remove_file)
+    unlink (file);
 
   g_free (cmd);
   g_free (base_name);

Modified: xfprint/trunk/printing-systems/cups/cups.c
===================================================================
--- xfprint/trunk/printing-systems/cups/cups.c	2006-08-04 21:16:44 UTC (rev 22661)
+++ xfprint/trunk/printing-systems/cups/cups.c	2006-08-04 22:17:10 UTC (rev 22662)
@@ -521,7 +521,7 @@
 /* Printing */
 /************/
 G_MODULE_EXPORT gboolean
-print_file (const gchar * printer, const gchar * original_name, const gchar * file)
+print_file (const gchar * printer, const gchar * original_name, const gchar * file, gboolean remove_file)
 {
   gchar *printer_name = NULL;
   gchar *printer_instance = NULL;
@@ -556,7 +556,8 @@
   cupsFreeDests (num_dests, dests);
   g_free (printer_name);
   g_free (printer_instance);
-  unlink (file);
+  if (remove_file)
+    unlink (file);
 
   return ret;
 }

Modified: xfprint/trunk/xfprint/print_dialog.c
===================================================================
--- xfprint/trunk/xfprint/print_dialog.c	2006-08-04 21:16:44 UTC (rev 22661)
+++ xfprint/trunk/xfprint/print_dialog.c	2006-08-04 22:17:10 UTC (rev 22662)
@@ -477,7 +477,8 @@
         
         gtk_tree_model_get (model, &iter, PRINTER_NAME_COLUMN, &printer, -1);
         
-        if (!printing_system_print_file (priv->ps, printer, priv->input_file, ofile))
+        if (!printing_system_print_file (priv->ps, printer, priv->input_file, ofile, 
+					 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->checkbutton_apply_filters))))
           xfce_err (_("An error occurred while trying to print the file"));
       
         g_free (printer);



More information about the Xfce4-commits mailing list