[gnome-control-center] background: Only accept URIs when creating items



commit c32b0da4e4e765a25ee66aef00a62b940af3d0e1
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Feb 14 13:03:30 2011 +0000

    background: Only accept URIs when creating items

 panels/background/cc-background-item.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/background/cc-background-item.c b/panels/background/cc-background-item.c
index c81ac91..288955e 100644
--- a/panels/background/cc-background-item.c
+++ b/panels/background/cc-background-item.c
@@ -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 *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]