From b32ef40cc7c4dfbc6376c37989e8203f744bc6de Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Fri, 2 Oct 2009 12:30:01 +0200 Subject: Remove the logic that re-applies the original enabled value. Now that we instant-apply the setting, this is not needed anymore. Also, this fixes a crasher. --- libempathy-gtk/empathy-account-widget.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'libempathy-gtk/empathy-account-widget.c') diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index ebe5b2797..d1704286d 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -66,7 +66,6 @@ typedef struct { gboolean simple; gboolean contains_pending_changes; - gboolean original_enabled_checkbox_value; /* An EmpathyAccountWidget can be used to either create an account or * modify it. When we are creating an account, this member is set to TRUE */ @@ -1294,17 +1293,16 @@ do_constructed (GObject *obj) GtkWidget *w; #endif guint nb_rows, nb_columns; + gboolean is_enabled; - priv->original_enabled_checkbox_value = - empathy_account_is_enabled (account); + is_enabled = empathy_account_is_enabled (account); #ifndef HAVE_NBTK priv->enabled_checkbox = gtk_check_button_new_with_label (_("Enabled")); gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON (priv->enabled_checkbox), - priv->original_enabled_checkbox_value); + GTK_TOGGLE_BUTTON (priv->enabled_checkbox), is_enabled); #else /* Translators: this is used only when built on a moblin platform */ w = gtk_label_new (_("Account:")); @@ -1313,8 +1311,7 @@ do_constructed (GObject *obj) priv->enabled_checkbox = nbtk_gtk_light_switch_new (); nbtk_gtk_light_switch_set_active ( - NBTK_GTK_LIGHT_SWITCH (priv->enabled_checkbox), - priv->original_enabled_checkbox_value); + NBTK_GTK_LIGHT_SWITCH (priv->enabled_checkbox), is_enabled); gtk_widget_show (w); #endif /* HAVE_NBTK */ @@ -1489,16 +1486,6 @@ empathy_account_widget_discard_pending_changes EmpathyAccountWidgetPriv *priv = GET_PRIV (widget); empathy_account_settings_discard_changes (priv->settings); - -#ifndef HAVE_NBTK - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->enabled_checkbox), - priv->original_enabled_checkbox_value); -#else - nbtk_gtk_light_switch_set_active ( - NBTK_GTK_LIGHT_SWITCH (priv->enabled_checkbox), - priv->original_enabled_checkbox_value); -#endif /* HAVE_NBTK */ - priv->contains_pending_changes = FALSE; } -- cgit v1.2.3