]> Pileus Git - ~andy/gtk/commitdiff
Fix the colord support in GtkPrinterCups when the PPD is loaded async
authorRichard Hughes <richard@hughsie.com>
Thu, 26 Apr 2012 16:13:49 +0000 (17:13 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 30 Apr 2012 10:22:12 +0000 (06:22 -0400)
If the PPD is not available when the printer is loaded then the PPD options are
not available and we can't get the correct qualifier to use with colord.

When the PPD becomes available, refresh the profile title to reflect reality.

https://bugzilla.gnome.org/show_bug.cgi?id=674890

modules/printbackends/cups/gtkprintercups.c

index 3a45e2f6da3a8bc082bdcd774f1f63a762618cd8..128b3b38542c0d7b6dd0e304fbddedadfdbcbc39 100644 (file)
@@ -505,6 +505,15 @@ colord_client_connect_cb (GObject *source_object,
 
   g_object_unref (printer);
 }
+
+static void
+colord_printer_details_aquired_cb (GtkPrinterCups *printer,
+                                   gboolean success,
+                                   gpointer user_data)
+{
+  /* refresh the device */
+  colord_update_device (printer);
+}
 #endif
 
 /**
@@ -550,6 +559,11 @@ gtk_printer_cups_new (const char      *name,
                          colord_client_connect_cb,
                          g_object_ref (printer));
     }
+
+    /* update the device when we read the PPD */
+    g_signal_connect (printer, "details-acquired",
+                      G_CALLBACK (colord_printer_details_aquired_cb),
+                      printer);
 #endif
   return printer;
 }