background: Treat empty URI as NULL
So that comparisons are easier.
This commit is contained in:
parent
758242bb8e
commit
5517949b4e
1 changed files with 8 additions and 1 deletions
|
@ -322,7 +322,10 @@ _set_uri (CcBackgroundItem *item,
|
|||
const char *value)
|
||||
{
|
||||
g_free (item->priv->uri);
|
||||
item->priv->uri = g_strdup (value);
|
||||
if (value && *value == '\0')
|
||||
item->priv->uri = NULL;
|
||||
else
|
||||
item->priv->uri = g_strdup (value);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
@ -819,6 +822,10 @@ files_equal (const char *a,
|
|||
GFile *file1, *file2;
|
||||
gboolean retval;
|
||||
|
||||
if (a == NULL ||
|
||||
b == NULL)
|
||||
return FALSE;
|
||||
|
||||
file1 = g_file_new_for_commandline_arg (a);
|
||||
file2 = g_file_new_for_commandline_arg (b);
|
||||
if (g_file_equal (file1, file2) == FALSE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue