[Bug 24146] Move data forms code to Wocky
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Sep 28 20:01:03 CEST 2009
http://bugs.freedesktop.org/show_bug.cgi?id=24146
--- Comment #3 from Will Thompson <will.thompson at collabora.co.uk> 2009-09-28 11:01:03 PST ---
Partial review up to 8fc141547d96a1ca69:
wocky_data_forms_field and wocky_data_forms_field_option should be
camel-cased.
extract_value_list() doesn't NULL-terminate the returned value. This
suggests that that code path isn't tested. :)
+ DEBUG ("Wrong field type for '%s': %s", type_str, var);
It's not a wrong type, it's an invalid type.
+ DEBUG ("No option provided for '%s'", var);
Options.
Why does wocky_data_forms_field_new() take ownership of the 'options'
list, but not of (eg) the default value?
+ if (value== NULL)
Style: add a space.
extract_search_keys_from_froms(): The last word should be "forms" :)
+ "server doesn't support any known search key");
keys plural.
+ /* list will be reveresed */
reversed.
+ if (!wocky_strdiff (value, "true"))
+ return wocky_g_value_slice_new_boolean (TRUE);
+ else if (!wocky_strdiff (value, "false"))
+ return wocky_g_value_slice_new_boolean (FALSE);
+ else
+ DEBUG ("Invalid boolean value: %s", value);
+ break;
>From the footnote assigned to the boolean type in XEP-0004 §3.3:
> 10. In accordance with Section 3.2.2.1 of XML Schema Part 2:
> Datatypes, the allowable lexical representations for the xs:boolean
> datatype are the strings "0" and "false" for the concept 'false' and
> the strings "1" and "true" for the concept 'true'; implementations
> MUST support both styles of lexical representation.
Amusingly, this branch produces "0" and "1", but only accepts "false"
and "true". :)
The name of wocky_data_forms_submit() seems a bit misleading. It
doesn't actually submit the form. Obviously it doing so would be
strange... Maybe it's worth the misleading name for brevity's sake?
--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the telepathy-bugs
mailing list