[empathy/gnome-2-28: 17/18] Remove the logic that re-applies the original enabled value.



commit b8e7413ad4741fea8da9e4eaf75ad29dd5491689
Author: Cosimo Cecchi <cosimo cecchi collabora co uk>
Date:   Fri Oct 2 12:30:01 2009 +0200

    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 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index ebe5b27..d170428 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;
 }
 



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