]> spindle.queued.net Git - midori/commitdiff
Compute a string if the identification string is empty
authorChristian Dywan <christian@twotoasts.de>
Sun, 12 Apr 2009 12:28:11 +0000 (14:28 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 12 Apr 2009 12:28:11 +0000 (14:28 +0200)
midori/midori-websettings.c

index 0edffc451b3659cdc5040bcf8a606ec162bc3c6e..08677f6a3dcbfcafeccae98d2a0e9709a887a3b1 100644 (file)
@@ -1138,8 +1138,8 @@ midori_web_settings_set_property (GObject*      object,
         if (web_settings->identify_as != MIDORI_IDENT_CUSTOM)
         {
             gchar* string = generate_ident_string (web_settings->identify_as);
-            g_object_set (object, "ident-string", string, NULL);
-            g_free (string);
+            katze_assign (web_settings->ident_string, string);
+            g_object_notify (object, "ident-string");
         }
         break;
     case PROP_IDENT_STRING:
@@ -1316,6 +1316,11 @@ midori_web_settings_get_property (GObject*    object,
         g_value_set_enum (value, web_settings->identify_as);
         break;
     case PROP_IDENT_STRING:
+        if (!g_strcmp0 (web_settings->ident_string, ""))
+        {
+            gchar* string = generate_ident_string (web_settings->identify_as);
+            katze_assign (web_settings->ident_string, string);
+        }
         g_value_set_string (value, web_settings->ident_string);
         break;
     case PROP_CACHE_SIZE: