[Webkit-unassigned] [Bug 76172] [GTK] Add basic printing support to WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 31 23:46:23 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=76172





--- Comment #14 from Carlos Garcia Campos <cgarcia at igalia.com>  2012-01-31 23:46:23 PST ---
(In reply to comment #12)
> (In reply to comment #7)
> > > > +        if (printerName) {
> > > > +            if (!strcmp(printerName, gtk_printer_get_name(printer)))
> > > > +                selectedPrinter = printer;
> > > 
> > > Nit: I think this would be more readable as if (printerName && !strcmp(...)), then you can drop the braces.
> > 
> > The thing is that we don't want to use the default printer if a printer name has been chosen by the user, so I would need to check again in the else, that printerName is NULL. So the printerName check is not just to avoid a crash in strcmp, but to check whether a printer has been specified, to use the default one otherwise.
> 
> I understand that, but the if (printername && !strcmp()) I suggested would work the same the current code does, or am I missing something? =)

Yes, but in that case I would need to check the printername is not NULL in both if branches

if (printername && !strcmp())
...
else if (!printername && printer_is_default)

So, I thought it was more clear that in case we have a printerName we are not interested in whether the printer is the default one or not.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list