SoupURI: add SOUP_URI_IS_VALID() and use it for basic precondition checks
In this patch, field setters don't have precondition checks for the
validity of the URI object itself, only a non-NULL check, to avoid
breaking existing code if it calls soup_uri_new (NULL) and then sets
fields in an unexpected order:
uri = soup_uri_new (NULL); /* uri is invalid */
soup_uri_set_host (uri, "www.google.com");
soup_uri_set_query (uri, "q=badgers");
soup_uri_set_scheme (uri, "http"); /* still invalid... */
soup_uri_set_path (uri, "/search"); /* finally valid */
Also annotate nullable setter parameters as (allow-none), to justify
why they don't have a precondition check.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977