All pastes #452728 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-22 13:58 UTC
rendered paste body
diff -rN -u old-grapevine/libgrapevine-gtk/gossip-account-widget-generic.c new-grapevine/libgrapevine-gtk/gossip-account-widget-generic.c
--- old-grapevine/libgrapevine-gtk/gossip-account-widget-generic.c      2007-04-22 15:58:10.000000000 +0200
+++ new-grapevine/libgrapevine-gtk/gossip-account-widget-generic.c      2007-04-22 15:58:11.000000000 +0200
@@ -65,11 +65,24 @@
 {
        const gchar *str;
        const gchar *param_name;
+        McProfile *profile;
+        const gchar *default_value;
 
        str = gtk_entry_get_text (GTK_ENTRY (widget));
        param_name = g_object_get_data (G_OBJECT (widget), "param_name");
-
-       mc_account_set_param_string (settings->account, param_name, str);
+        profile = mc_account_get_profile(settings->account);
+        default_value = mc_profile_get_default_setting(profile, param_name);
+        
+        /* The "default" default value is the empty string */
+        if (!default_value) default_value = "";
+        
+        if (strcmp(str, default_value) == 0) {
+                /* Don't set the value to the same as the default */
+                mc_account_unset_param (settings->account, param_name);
+
+        } else {
+               mc_account_set_param_string (settings->account, param_name, str);
+        }
 
        return FALSE;
 }