summaryrefslogtreecommitdiff
path: root/panels/background/cc-background-item.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2011-02-14 07:42:58 +0000
committerBastien Nocera <hadess@hadess.net>2011-02-14 09:44:05 +0000
commit5517949b4e23bc7e7686bc5ce29c7e4e06267458 (patch)
treefbca7a8e222252b83bcc90a41eb2bb03a17bdad0 /panels/background/cc-background-item.c
parent758242bb8e43967e0a589e2cdd0597fcff2352fb (diff)
downloadgnome-control-center-5517949b4e23bc7e7686bc5ce29c7e4e06267458.tar.gz
background: Treat empty URI as NULL
So that comparisons are easier.
Diffstat (limited to 'panels/background/cc-background-item.c')
-rw-r--r--panels/background/cc-background-item.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/panels/background/cc-background-item.c b/panels/background/cc-background-item.c
index 535abc71b..b110a758c 100644
--- a/panels/background/cc-background-item.c
+++ b/panels/background/cc-background-item.c
@@ -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)