gpa problems



I just tracked down some problems with printer removal in our async
print dialog. The situation is that the user has selected a regular
printer, say "hplj1". Then cupsd gets restarted. libgnomecups notices
this and emits ::gone on all printers - they will reappear over time
as cups discovers them and libgnomecups picks them up again. But if the
user clicks on another list entry, e.g. the "Print to file" one,
before "hplj1" is back, gedit crashes in gpa_reference_set_value(),
since old->parent is NULL. I see a couple of problems/questionable
design choices in gpa list and reference causing this:

a) default list members are not reset when the node is removed 
   from the list, the parent of the removed node is reset to 
   NULL, though
b) for reference nodes, gpa_node_set_path_value() uses the 
   parent of the old value to lookup the new value by id and
   can't gracefully handle old->parent being NULL
c) gpa_reference_set_reference() doesn't emit the ::modified signal

I have no good fix for these issues currently, instead I replaced

gpa_node_set_path_value (selector->config, 
                         "Printer", 
                         gpa_node_id (node))

in gpa-printer-selector.c:selection_changed_cb by

printer = gpa_node_lookup (selector->config, "Printer");
gpa_reference_set_reference (GPA_REFERENCE (printer), node);
gpa_node_emit_modified (printer);



Regards,  Matthias




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