[gtk+/gtk-3-4] Fix the colord support in GtkPrinterCups when the PPD is loaded async



commit 1aa7d8c5461644ba4437eb2cca220412b42f5305
Author: Richard Hughes <richard hughsie com>
Date:   Thu Apr 26 17:13:49 2012 +0100

    Fix the colord support in GtkPrinterCups when the PPD is loaded async
    
    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 |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/modules/printbackends/cups/gtkprintercups.c b/modules/printbackends/cups/gtkprintercups.c
index e8c652f..e10b449 100644
--- a/modules/printbackends/cups/gtkprintercups.c
+++ b/modules/printbackends/cups/gtkprintercups.c
@@ -504,6 +504,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
 
 /**
@@ -549,6 +558,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;
 }



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