gimp r25383 - in trunk: . plug-ins/print



Author: neo
Date: Sun Apr  6 20:45:27 2008
New Revision: 25383
URL: http://svn.gnome.org/viewvc/gimp?rev=25383&view=rev

Log:
2008-04-06  Sven Neumann  <sven gimp org>

	* plug-ins/print/print.c (page_setup): do a query for the
	temporary procedure installed by the 'file-print-gtk' procedure.
	Temporary solution until bug #344818 has been addressed.



Modified:
   trunk/ChangeLog
   trunk/plug-ins/print/print.c

Modified: trunk/plug-ins/print/print.c
==============================================================================
--- trunk/plug-ins/print/print.c	(original)
+++ trunk/plug-ins/print/print.c	Sun Apr  6 20:45:27 2008
@@ -292,8 +292,10 @@
 static GimpPDBStatusType
 page_setup (gint32 image_ID)
 {
-  GtkPrintOperation *operation;
-  gchar             *name;
+  GtkPrintOperation  *operation;
+  gchar              *name;
+  gchar             **matches;
+  gint                num_matches;
 
   gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
@@ -308,20 +310,35 @@
   /* now notify a running print procedure about this change */
   name = print_temp_proc_name (image_ID);
 
-  if (name)
+  /* FIXME: There should be a better way to query for a procedure.
+   *        Also this code has a race condition. The best solution
+   *        would be to catch the error somehow (see bug #344818).
+   */
+  gimp_procedural_db_query (name,
+                            ".*", ".*", ".*", ".*", ".*", ".*",
+                            &num_matches, &matches);
+
+  if (num_matches)
     {
       GimpParam *return_vals;
       gint       n_return_vals;
+      gint       i;
 
       return_vals = gimp_run_procedure (name,
                                         &n_return_vals,
                                         GIMP_PDB_IMAGE, image_ID,
                                         GIMP_PDB_END);
+
       gimp_destroy_params (return_vals, n_return_vals);
 
-      g_free (name);
+      for (i = 0; i < num_matches; i++)
+        g_free (matches[i]);
+
+      g_free (matches);
     }
 
+  g_free (name);
+
   return GIMP_PDB_SUCCESS;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]