Re: Speeding up the startup time of the print dialog (2/2)
- From: Matthias Clasen <mclasen redhat com>
- To: gnome-print-list gnome org
- Subject: Re: Speeding up the startup time of the print dialog (2/2)
- Date: Tue, 31 Aug 2004 12:54:10 -0400
On Fri, 2004-08-27 at 16:16, Matthias Clasen wrote:
> Here is the second patch, which makes libgnomeprint use the
> async ppd retrieval api introduced in the first patch. It changes
> way in which the cups module populates the printer list to be
> entirely done via the printer_added hooks of libgnomecups.
>
> Matthias
It turned out this patch breaks gpa_config_from_string(), which
makes the assumption that the printer list is fully populated at
time it is called. With asynchronous loading of printers this is
no longer the case. The following patch rectifies this by delaying
the parsing of the xml until the printer list is sufficently
populated. Additionally, we added a default-changed signal to
GPAList and use that to pick up the CUPS default printer in case
we don't have a stored configuration.
Matthias
? LOG
? async.diff
? empty
? latest.patch
? libgnomeprint.patch
? doc/reference/libgnomeprint.interfaces
? doc/reference/libgnomeprint.prerequisites
? doc/reference/xml
Index: libgnomeprint/gpa/gpa-config.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gpa/gpa-config.c,v
retrieving revision 1.27
diff -u -r1.27 gpa-config.c
--- libgnomeprint/gpa/gpa-config.c 17 Nov 2003 00:05:56 -0000 1.27
+++ libgnomeprint/gpa/gpa-config.c 31 Aug 2004 16:44:08 -0000
@@ -72,7 +72,7 @@
static void
gpa_config_class_init (GPAConfigClass *klass)
{
- GObjectClass *object_class;
+ GObjectClass *object_class;
GPANodeClass *node_class;
object_class = (GObjectClass*) klass;
@@ -162,21 +162,43 @@
return TRUE;
}
+static void
+default_changed_cb (GPAList *printers, GPAConfig *config)
+{
+ GPANode *printer;
+ GPANode *settings;
+
+ printer = gpa_list_get_default (printers);
+ settings = gpa_printer_get_default_settings (GPA_PRINTER (printer));
+
+ gpa_reference_set_reference (GPA_REFERENCE (config->printer), printer);
+ gpa_reference_set_reference (GPA_REFERENCE (config->settings), settings);
+}
+
GPAConfig *
gpa_config_new_full (GPAPrinter *printer, GPASettings * settings)
{
GPAConfig * config;
+ GPAList * printers;
g_return_val_if_fail (GPA_IS_PRINTER (printer), NULL);
g_return_val_if_fail (GPA_IS_SETTINGS (settings), NULL);
config = (GPAConfig *) gpa_node_new (GPA_TYPE_CONFIG, "GpaConfigRootNode");
-
+
gpa_reference_set_reference (GPA_REFERENCE (config->printer), GPA_NODE (printer));
gpa_reference_set_reference (GPA_REFERENCE (config->settings), GPA_NODE (settings));
gpa_node_reverse_children (GPA_NODE (config));
+ /* Install a signal handler to listen for changes of the default printer of the
+ * transport. This is necessary to handle the asynchronous loading of the printers
+ * done in the CUPS transport. Note that gpa_config_new_from_string () disconnects
+ * the signal handler once it succeeds in setting the printer from the loaded config.
+ */
+ printers = gpa_get_printers ();
+ g_signal_connect (printers, "default-changed", G_CALLBACK (default_changed_cb), config);
+
return config;
}
@@ -224,68 +246,24 @@
return GPA_NODE (new);
}
-
-gchar *
-gpa_config_to_string (GPAConfig *config, guint flags)
-{
- GPANode *printer;
- GPANode *settings;
- xmlDocPtr doc;
- xmlNodePtr root, node;
- xmlChar *xml_str;
- gchar *str;
- gint size;
-
- g_return_val_if_fail (config != NULL, NULL);
- g_return_val_if_fail (GPA_IS_CONFIG (config), NULL);
- g_return_val_if_fail (config->printer != NULL, NULL);
- g_return_val_if_fail (config->settings != NULL, NULL);
-
- printer = GPA_REFERENCE_REFERENCE (config->printer);
- settings = GPA_REFERENCE_REFERENCE (config->settings);
-
- g_return_val_if_fail (GPA_IS_PRINTER (printer), NULL);
- g_return_val_if_fail (GPA_IS_SETTINGS (settings), NULL);
-
- doc = xmlNewDoc ("1.0");
- root = xmlNewDocNode (doc, NULL, "GnomePrintConfig", NULL);
- xmlSetProp (root, "Version", "2.1");
- xmlSetProp (root, "LibgnomeprintVersion", VERSION);
- xmlSetProp (root, "SelectedSettings", gpa_node_id (settings));
- xmlDocSetRootElement (doc, root);
-
- node = gpa_settings_to_tree (GPA_SETTINGS (settings));
-
- xmlAddChild (root, node);
-
- xmlDocDumpFormatMemory (doc, &xml_str, &size, TRUE);
- str = g_strndup (xml_str, size);
- xmlFree (xml_str);
-
- xmlFreeDoc (doc);
-
- return str;
-}
-
-GPAConfig *
-gpa_config_from_string (const gchar *str, guint flags)
+static gboolean
+gpa_delayed_config_from_string (GPAConfig *config, const gchar *str, guint flags)
{
GPASettings *new_settings = NULL;
GPASettings *settings = NULL;
GPAPrinter *printer = NULL;
- GPAConfig *config = NULL;
GPAModel *model = NULL;
GPANode *child;
xmlDocPtr doc = NULL;
xmlNodePtr tree, node;
xmlChar *version, *settings_id, *printer_id, *model_id;
+ gboolean handled = TRUE;
version = settings_id = printer_id = model_id = NULL;
- gpa_init ();
-
- if (!str || !str[0])
+ if (!str || !str[0]) {
goto config_from_string_done;
+ }
doc = xmlParseDoc ((char*) str);
if (!doc) {
@@ -346,6 +324,18 @@
goto config_from_string_done;
}
+ printer = (GPAPrinter *) gpa_printer_get_by_id (printer_id);
+ if (!printer) {
+ handled = FALSE;
+ goto config_from_string_done;
+ }
+
+ /* We got the printer; set it as default and stop listening to changes of the
+ * default printer from the transports.
+ */
+ g_signal_handlers_disconnect_by_func (gpa_get_printers (), default_changed_cb, config);
+ gpa_reference_set_reference (GPA_REFERENCE (config->printer), GPA_NODE (printer));
+
model = (GPAModel *) gpa_model_hash_lookup (model_id);
if (!model) {
/* Right now we just drop the old config, this will happen when a printer
@@ -354,18 +344,10 @@
* survive a printer or host change. However, we be a lot smarter about this
* in the future (Chema)
*/
- g_print ("Model not found, discarding config\n");
+ handled = FALSE;
goto config_from_string_done;
}
- printer = (GPAPrinter *) gpa_printer_get_by_id (printer_id);
- if (!printer) {
- /* ditto (Chema)
- */
- g_print ("Printer not found, discarding config\n");
- goto config_from_string_done;
- }
-
new_settings = (GPASettings *) gpa_settings_new_from_model_and_tree (GPA_NODE (model), node);
if (!new_settings) {
g_warning ("Could not create settings from model and tree\n");
@@ -386,15 +368,21 @@
}
child = child->next;
}
-
- config = gpa_config_new_full (printer, settings);
+
+ gpa_reference_set_reference (GPA_REFERENCE (config->settings), GPA_NODE (settings));
+
+ gpa_node_reverse_children (GPA_NODE (config));
+
+ handled = TRUE;
gpa_node_unref (GPA_NODE (new_settings));
gpa_node_unref (GPA_NODE (printer));
gpa_node_unref (GPA_NODE (settings));
+ gpa_node_unref (GPA_NODE (model));
new_settings = NULL;
- settings = NULL;
printer = NULL;
+ settings = NULL;
+ model = NULL;
config_from_string_done:
my_xmlFree (version);
@@ -403,12 +391,103 @@
my_xmlFree (printer_id);
my_xmlFreeDoc (doc);
- if (!config) {
- my_gpa_node_unref (GPA_NODE (printer));
- my_gpa_node_unref (GPA_NODE (model));
- my_gpa_node_unref (GPA_NODE (settings));
- config = gpa_config_new ();
+ my_gpa_node_unref (GPA_NODE (printer));
+ my_gpa_node_unref (GPA_NODE (model));
+ my_gpa_node_unref (GPA_NODE (settings));
+
+ return handled;
+}
+
+
+typedef struct {
+ gulong id;
+ GPANode *config;
+ gchar *str;
+ guint flags;
+} DelayedConfig;
+
+static void
+delay_config (GPAList *printers, GObject *child, DelayedConfig *data)
+{
+ if (!gpa_delayed_config_from_string (data->config, data->str, data->flags)) {
+ /* delaying further until the printer appears */
+ return;
+ }
+
+ g_signal_handler_disconnect (printers, data->id);
+ gpa_node_unref (data->config);
+ g_free (data->str);
+ g_free (data);
+}
+
+GPAConfig *
+gpa_config_from_string (const gchar *str, guint flags)
+{
+ GPAConfig *config;
+
+ gpa_init ();
+
+ config = gpa_config_new ();
+
+ /* We need to delay the parsing of the string until the
+ * printer list is sufficently populated.
+ */
+ if (!gpa_delayed_config_from_string (config, str, flags)) {
+ GPAList *printers;
+ DelayedConfig *data;
+
+ data = g_new0 (DelayedConfig, 1);
+ data->config = gpa_node_ref (config);
+ data->str = g_strdup (str);
+ data->flags = flags;
+ printers = gpa_get_printers ();
+ data->id = g_signal_connect (printers, "child-added", delay_config, data);
}
return config;
}
+
+
+
+gchar *
+gpa_config_to_string (GPAConfig *config, guint flags)
+{
+ GPANode *printer;
+ GPANode *settings;
+ xmlDocPtr doc;
+ xmlNodePtr root, node;
+ xmlChar *xml_str;
+ gchar *str;
+ gint size;
+
+ g_return_val_if_fail (config != NULL, NULL);
+ g_return_val_if_fail (GPA_IS_CONFIG (config), NULL);
+ g_return_val_if_fail (config->printer != NULL, NULL);
+ g_return_val_if_fail (config->settings != NULL, NULL);
+
+ printer = GPA_REFERENCE_REFERENCE (config->printer);
+ settings = GPA_REFERENCE_REFERENCE (config->settings);
+
+ g_return_val_if_fail (GPA_IS_PRINTER (printer), NULL);
+ g_return_val_if_fail (GPA_IS_SETTINGS (settings), NULL);
+
+ doc = xmlNewDoc ("1.0");
+ root = xmlNewDocNode (doc, NULL, "GnomePrintConfig", NULL);
+ xmlSetProp (root, "Version", "2.1");
+ xmlSetProp (root, "LibgnomeprintVersion", VERSION);
+ xmlSetProp (root, "SelectedSettings", gpa_node_id (settings));
+ xmlDocSetRootElement (doc, root);
+
+ node = gpa_settings_to_tree (GPA_SETTINGS (settings));
+
+ xmlAddChild (root, node);
+
+ xmlDocDumpFormatMemory (doc, &xml_str, &size, TRUE);
+ str = g_strndup (xml_str, size);
+ xmlFree (xml_str);
+
+ xmlFreeDoc (doc);
+
+ return str;
+}
+
Index: libgnomeprint/gpa/gpa-list.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gpa/gpa-list.c,v
retrieving revision 1.21
diff -u -r1.21 gpa-list.c
--- libgnomeprint/gpa/gpa-list.c 1 Feb 2003 00:18:56 -0000 1.21
+++ libgnomeprint/gpa/gpa-list.c 31 Aug 2004 16:44:08 -0000
@@ -43,7 +43,9 @@
static gboolean gpa_list_verify (GPANode *node);
static gboolean gpa_list_set_value (GPANode *node, const guchar *value);
+enum {DEFAULT_CHANGED, LAST_SIGNAL};
static GPANodeClass *parent_class = NULL;
+static guint list_signals [LAST_SIGNAL] = {0};
GType
gpa_list_get_type (void) {
@@ -78,6 +80,14 @@
node_class->set_value = gpa_list_set_value;
node_class->verify = gpa_list_verify;
+
+ list_signals[DEFAULT_CHANGED] = g_signal_new ("default-changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ NULL,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
static void
@@ -163,21 +173,28 @@
gboolean
gpa_list_set_default (GPAList *list, GPANode *def)
{
+ gboolean result;
+
g_return_val_if_fail (list != NULL, FALSE);
g_return_val_if_fail (def != NULL, FALSE);
g_return_val_if_fail (GPA_IS_LIST (list), FALSE);
-
+
if (list->can_have_default == FALSE) {
g_warning ("Trying to set the default of a GPAList which has ->can_have_default to FALSE\n");
return FALSE;
}
if (list->def)
- return gpa_reference_set_reference (GPA_REFERENCE (list->def), def);
+ result = gpa_reference_set_reference (GPA_REFERENCE (list->def), def);
+ else {
+ list->def = gpa_reference_new (def, "Default");
+ result = TRUE;
+ }
- list->def = gpa_reference_new (def, "Default");
- return TRUE;
+ g_signal_emit (G_OBJECT (list), list_signals [DEFAULT_CHANGED], 0);
+
+ return result;
}
Index: libgnomeprint/modules/cups/gnome-print-cups.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/modules/cups/gnome-print-cups.c,v
retrieving revision 1.35
diff -u -r1.35 gnome-print-cups.c
--- libgnomeprint/modules/cups/gnome-print-cups.c 21 Aug 2004 04:31:35 -0000 1.35
+++ libgnomeprint/modules/cups/gnome-print-cups.c 31 Aug 2004 16:44:09 -0000
@@ -43,6 +43,7 @@
#include <libgnomecups/gnome-cups-printer.h>
#include "libgnomeprint/gnome-print-i18n.h"
+static void get_ppd_cb (guint id, ppd_file_t *ppd, GError **error, gpointer user_data);
/* Argument order: id, name */
@@ -144,7 +145,14 @@
struct GnomePrintCupsNewPrinterCbData
{
GPAList *list;
- char *path;
+ char *module_path;
+};
+
+struct GnomePrintCupsLoadPrinterData
+{
+ GnomeCupsPrinter *printer;
+ GPAList *list;
+ char *module_path;
};
G_MODULE_EXPORT void gpa_module_load_data (GPAPrinter *printer);
@@ -412,44 +420,37 @@
return (GPAModel *)model;
}
-static gboolean
-append_printer (GPAList *printers_list, GnomeCupsPrinter *cupsprinter,
- gboolean is_default, const gchar *path)
-{
- gboolean retval = FALSE;
- const char *name = gnome_cups_printer_get_name (cupsprinter);
- GPANode *printer = gpa_printer_new_stub (name, name, path);
-
- if (printer != NULL && gpa_node_verify (printer)) {
- gpa_list_prepend (printers_list, printer);
- if (is_default) {
- gpa_list_set_default (printers_list, printer);
- gpa_module_load_data (GPA_PRINTER (printer));
- }
- retval = TRUE;
- g_signal_connect (cupsprinter, "gone",
- G_CALLBACK (printer_gone_cb),
- printers_list);
- }
-
- if (retval == FALSE) {
- g_warning ("The CUPS printer %s could not be created\n", name);
- my_gpa_node_unref (printer);
- }
-
- return retval;
+static void
+ free_ppd_retrieval_data (gpointer p)
+ {
+ struct GnomePrintCupsLoadPrinterData *data = p;
+ g_object_unref (data->printer);
+ g_free (data->module_path);
+ g_free (data);
+ }
+
+ static void
+ start_printer_ppd_retrieval (GnomeCupsPrinter *printer,
+ GPAList *printers_list,
+ const char *module_path)
+ {
+ struct GnomePrintCupsLoadPrinterData *loaddata;
+ loaddata = g_new0 (struct GnomePrintCupsLoadPrinterData, 1);
+ loaddata->printer = g_object_ref (printer);
+ loaddata->list = printers_list;
+ loaddata->module_path = g_strdup (module_path);
+ gnome_cups_printer_get_ppd_async (printer,
+ get_ppd_cb,
+ loaddata,
+ free_ppd_retrieval_data);
}
static GModule *handle = NULL;
static void
gnome_print_cups_printer_list_append (gpointer printers_list,
- const gchar *path)
+ const gchar *module_path)
{
- /* const gchar *def = cupsGetDefault();
- not reliable, dests[i].is_default used instead */
- GList *printers = NULL;
- GList *link;
struct GnomePrintCupsNewPrinterCbData *data;
g_return_if_fail (printers_list != NULL);
@@ -457,34 +458,17 @@
/* make ourselves resident */
if (!handle)
- handle = g_module_open (path, G_MODULE_BIND_LAZY);
+ handle = g_module_open (module_path, G_MODULE_BIND_LAZY);
- gnome_cups_init (NULL);
data = g_new0 (struct GnomePrintCupsNewPrinterCbData, 1);
data->list = printers_list;
- data->path = g_strdup (path);
+ data->module_path = g_strdup (module_path);
+ /* install printer_added_cb *before* calling gnome_cups_init(),
+ * since that gets the list of printers
+ */
gnome_cups_printer_new_printer_notify_add ((GnomeCupsPrinterAddedCallback) printer_added_cb, data);
-
- printers = gnome_cups_get_printers ();
-
- for (link = printers; link; link = link->next) {
- const char *name;
- GnomeCupsPrinter *printer;
-
- name = link->data;
- printer = gnome_cups_printer_get (name);
-
- if (printer) {
- append_printer (GPA_LIST (printers_list),
- printer,
- gnome_cups_printer_get_is_default (printer),
- path);
- g_object_unref (G_OBJECT (printer));
- }
- }
+ gnome_cups_init (NULL);
- gnome_cups_printer_list_free (printers);
-
return;
}
@@ -557,7 +541,7 @@
gpa_node_attach (state, jobcount);
}
len_str = g_strdup_printf ("%d", gnome_cups_printer_get_job_count (cupsprinter));
- gpa_node_set_value (jobcount, str);
+ gpa_node_set_value (jobcount, len_str);
g_free (len_str);
}
@@ -580,6 +564,115 @@
}
static void
+get_ppd_cb (guint id, ppd_file_t *ppd, GError **error, gpointer user_data)
+{
+ struct GnomePrintCupsLoadPrinterData *data = user_data;
+ const char *name;
+ GnomeCupsPrinter *cupsprinter;
+ GPANode *printer = NULL;
+ GPANode *settings = NULL;
+ gboolean success = FALSE;
+ GPAModel *model = NULL;
+ GPAList *printers_list;
+
+ cupsprinter = data->printer;
+ printers_list = data->list;
+ name = gnome_cups_printer_get_name (data->printer);
+
+ if (ppd) {
+ model = get_model (name, ppd);
+ } else {
+ g_message ("The ppd file for the CUPS printer %s "
+ "could not be loaded.", name);
+ model = get_model_no_ppd (name);
+ }
+
+ if (model == NULL) {
+ g_warning ("Couldn't create model for %s!\n", name);
+ goto out;
+ }
+
+ settings = gpa_settings_new (model, "Default", "SetIdFromCups");
+ if (settings == NULL) {
+ g_warning ("Couldn't create settings for %s!\n", name);
+ goto out;
+ }
+
+ printer = gpa_printer_new_stub (name, name, data->module_path);
+
+ if (printer != NULL && gpa_node_verify (printer)) {
+ gnome_print_cups_adjust_settings (GPA_SETTINGS (settings),
+ cupsprinter);
+
+ success = gpa_printer_complete_stub (GPA_PRINTER (printer),
+ model,
+ GPA_SETTINGS (settings));
+
+ if (success) {
+ gpa_list_prepend (printers_list, printer);
+ if (gnome_cups_printer_get_is_default (cupsprinter)) {
+ gpa_list_set_default (printers_list, printer);
+ }
+ g_signal_connect (cupsprinter, "gone",
+ G_CALLBACK (printer_gone_cb),
+ printers_list);
+ }
+ } else {
+ g_warning ("The CUPS printer %s could not be created\n", name);
+ my_gpa_node_unref (printer);
+ goto out;
+ }
+
+ if (success) {
+ add_printer_location (cupsprinter, GPA_PRINTER (printer));
+ attributes_changed_cb (cupsprinter, GPA_PRINTER (printer));
+ }
+
+ /* Do we have to add any further instances */
+ /* FIXME - punt on instance bits for now */
+/* { */
+/* char *id = g_strdup_printf ("SetIdFromCups-%s", printer->name); */
+/* settings = gpa_settings_new (model, printer->name, id); */
+/* g_free (id); */
+/* id = NULL; */
+/* if (settings != NULL) { */
+/* gnome_print_cups_adjust_settings (GPA_SETTINGS (settings), */
+/* cupsprinter); */
+/* gpa_list_prepend (GPA_NODE (printer->settings), */
+/* GPA_NODE (settings)); */
+/* GPA_SETTINGS (settings)->printer */
+/* = gpa_reference_new (GPA_NODE (printer), "Printer"); */
+/* } */
+/* } */
+
+ out:
+ if (success == FALSE) {
+ g_warning ("The data for the CUPS printer %s "
+ "could not be loaded.", name);
+
+ if (model != NULL)
+ my_gpa_node_unref (GPA_NODE (model));
+ if (settings != NULL)
+ my_gpa_node_unref (settings);
+ }
+
+ if (ppd) {
+ ppdClose (ppd);
+ }
+}
+
+static void
+printer_attributes_changed_cb (GnomeCupsPrinter *printer,
+ gpointer d)
+{
+ struct GnomePrintCupsNewPrinterCbData *data = d;
+ start_printer_ppd_retrieval (printer,
+ data->list,
+ data->module_path);
+ g_object_unref (printer);
+}
+
+static void
printer_added_cb (const char *name, struct GnomePrintCupsNewPrinterCbData *data)
{
GPANode *node;
@@ -591,13 +684,14 @@
}
printer = gnome_cups_printer_get (name);
- if (printer != NULL) {
- append_printer (data->list, printer, FALSE, data->path);
- g_object_unref (printer);
+ if (!gnome_cups_printer_get_attributes_initialized (printer)) {
+ g_signal_connect (printer,
+ "attributes-changed",
+ G_CALLBACK (printer_attributes_changed_cb),
+ data);
+ } else {
+ printer_attributes_changed_cb (printer, data);
}
- else
- g_warning ("Printer %s does not exist!", name);
-
}
static void
@@ -655,79 +749,6 @@
G_MODULE_EXPORT void gpa_module_load_data (GPAPrinter *printer)
{
- GPANode *settings = NULL;
- GPAModel *model = NULL;
- const char *name = printer->name;
- ppd_file_t *ppd = NULL;
- gboolean success = FALSE;
- GnomeCupsPrinter *cupsprinter;
-
- if (printer->is_complete)
- return;
-
- cupsprinter = gnome_cups_printer_get (printer->name);
-
- if (cupsprinter) {
- ppd = gnome_cups_printer_get_ppd (cupsprinter);
- if (ppd) {
- model = get_model (name, ppd);
- }
- }
- if (!ppd) {
- g_warning ("The ppd file for the CUPS printer %s "
- "could not be loaded.", name);
- model = get_model_no_ppd (name);
- }
- if (model == NULL)
- goto gpa_module_load_data_exit;
-
- settings = gpa_settings_new (model, "Default", "SetIdFromCups");
- if (settings == NULL)
- goto gpa_module_load_data_exit;
-
- gnome_print_cups_adjust_settings (GPA_SETTINGS (settings), cupsprinter);
-
- success = gpa_printer_complete_stub (printer, model,
- GPA_SETTINGS (settings));
-
- add_printer_location (cupsprinter, printer);
- attributes_changed_cb (cupsprinter, printer);
-
- /* Do we have to add any further instances */
- /* FIXME - punt on instance bits for now */
-/* { */
-/* char *id = g_strdup_printf ("SetIdFromCups-%s", name); */
-/* settings = gpa_settings_new (model, name, id); */
-/* g_free (id); */
-/* id = NULL; */
-/* if (settings != NULL) { */
-/* gnome_print_cups_adjust_settings (GPA_SETTINGS (settings), */
-/* cupsprinter); */
-/* gpa_list_prepend (GPA_NODE (printer->settings), */
-/* GPA_NODE (settings)); */
-/* GPA_SETTINGS (settings)->printer */
-/* = gpa_reference_new (GPA_NODE (printer), "Printer"); */
-/* } */
-/* } */
-
- gpa_module_load_data_exit:
- g_object_unref (cupsprinter);
- if (success == FALSE) {
- g_warning ("The data for the CUPS printer %s "
- "could not be loaded.", name);
-
- if (model != NULL)
- my_gpa_node_unref (GPA_NODE (model));
- if (settings != NULL)
- my_gpa_node_unref (settings);
- }
-
- if (ppd) {
- ppdClose (ppd);
- }
-
-/* gpa_utils_dump_tree (GPA_NODE (printer),5); */
- return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]