background: Only accept URIs when creating items
This commit is contained in:
parent
715474fb30
commit
c32b0da4e4
1 changed files with 5 additions and 3 deletions
|
@ -263,7 +263,6 @@ update_info (CcBackgroundItem *item,
|
||||||
|
|
||||||
if (info != NULL)
|
if (info != NULL)
|
||||||
g_object_unref (info);
|
g_object_unref (info);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -322,10 +321,13 @@ _set_uri (CcBackgroundItem *item,
|
||||||
const char *value)
|
const char *value)
|
||||||
{
|
{
|
||||||
g_free (item->priv->uri);
|
g_free (item->priv->uri);
|
||||||
if (value && *value == '\0')
|
if (value && *value == '\0') {
|
||||||
item->priv->uri = NULL;
|
item->priv->uri = NULL;
|
||||||
else
|
} else {
|
||||||
|
if (value && strstr (value, "://") == NULL)
|
||||||
|
g_warning ("URI '%s' is invalid", value);
|
||||||
item->priv->uri = g_strdup (value);
|
item->priv->uri = g_strdup (value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue