[frogr] Properly handle response for the settings dialog



commit 4f027a912c0eebbaeb0059c8f3c20def68b2e053
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Mon Apr 9 03:11:38 2012 +0200

    Properly handle response for the settings dialog

 src/frogr-settings-dialog.c |   41 ++++++++++++++++++++++-------------------
 1 files changed, 22 insertions(+), 19 deletions(-)
---
diff --git a/src/frogr-settings-dialog.c b/src/frogr-settings-dialog.c
index 403bf98..e5030bc 100644
--- a/src/frogr-settings-dialog.c
+++ b/src/frogr-settings-dialog.c
@@ -872,25 +872,28 @@ static void _dialog_response_cb (GtkDialog *dialog, gint response, gpointer data
   FrogrSettingsDialog *self = FROGR_SETTINGS_DIALOG (dialog);
   FrogrSettingsDialogPrivate *priv = FROGR_SETTINGS_DIALOG_GET_PRIVATE (self);
 
-  /* Try to save data if response is OK */
-  if (response == GTK_RESPONSE_OK && _save_data (self) == FALSE)
-      return;
-
-  /* Fetch tags if needed */
-  if (priv->enable_tags_autocompletion)
-    frogr_controller_fetch_tags_if_needed (priv->controller);
-
-  /* Update proxy status */
-  if (priv->use_proxy)
-    frogr_controller_set_proxy (priv->controller,
-                                priv->use_gnome_proxy,
-                                priv->proxy_host, priv->proxy_port,
-                                priv->proxy_username, priv->proxy_password);
-  else
-    frogr_controller_set_proxy (priv->controller, FALSE, NULL, NULL, NULL, NULL);
-
-  /* Update dark theme related stuff */
-  frogr_controller_set_use_dark_theme (priv->controller, priv->use_dark_theme);
+  if (response == GTK_RESPONSE_OK)
+    {
+      /* Try to save data if response is OK */
+      if (!_save_data (self))
+        return;
+
+      /* Fetch tags if needed */
+      if (priv->enable_tags_autocompletion)
+        frogr_controller_fetch_tags_if_needed (priv->controller);
+
+      /* Update proxy status */
+      if (priv->use_proxy)
+        frogr_controller_set_proxy (priv->controller,
+                                    priv->use_gnome_proxy,
+                                    priv->proxy_host, priv->proxy_port,
+                                    priv->proxy_username, priv->proxy_password);
+      else
+        frogr_controller_set_proxy (priv->controller, FALSE, NULL, NULL, NULL, NULL);
+
+      /* Update dark theme related stuff */
+      frogr_controller_set_use_dark_theme (priv->controller, priv->use_dark_theme);
+    }
 
   gtk_widget_hide (GTK_WIDGET (self));
 }



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