From f5b69fe95891fd20bdce7100701799c3f997f1d7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 10 Feb 2010 08:44:09 -0600 Subject: Making it so that you can't set an ID twice instead of just issuing a warning. --- src/libappindicator/app-indicator.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/libappindicator/app-indicator.c') diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index fb6e7dc..ea823ff 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -441,16 +441,15 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu switch (prop_id) { case PROP_ID: - if (priv->id != NULL) { - g_warning ("Resetting ID value when I already had a value of: %s", priv->id); - g_free (priv->id); - priv->id = NULL; - } + if (priv->id != NULL) { + g_warning ("Resetting ID value when I already had a value of: %s", priv->id); + break; + } - priv->id = g_strdup (g_value_get_string (value)); + priv->id = g_strdup (g_value_get_string (value)); - check_connect (self); - break; + check_connect (self); + break; case PROP_CATEGORY: enum_val = g_enum_get_value_by_nick ((GEnumClass *) g_type_class_ref (APP_INDICATOR_TYPE_INDICATOR_CATEGORY), -- cgit v1.2.3