background: Only accept URIs when creating items

This commit is contained in:
Bastien Nocera 2011-02-14 13:03:30 +00:00
parent 715474fb30
commit c32b0da4e4

View file

@ -263,7 +263,6 @@ update_info (CcBackgroundItem *item,
if (info != NULL)
g_object_unref (info);
}
gboolean
@ -322,10 +321,13 @@ _set_uri (CcBackgroundItem *item,
const char *value)
{
g_free (item->priv->uri);
if (value && *value == '\0')
if (value && *value == '\0') {
item->priv->uri = NULL;
else
} else {
if (value && strstr (value, "://") == NULL)
g_warning ("URI '%s' is invalid", value);
item->priv->uri = g_strdup (value);
}
}
const char *