[epiphany] ephy-window: Simplify ephy_window_close()



commit 91464eef94f05c139aa60fc8bebcc3e7fad62281
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed Aug 28 22:23:07 2013 +0300

    ephy-window: Simplify ephy_window_close()
    
    Simply use one if block, also put the boolean variable check first.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695642

 src/ephy-window.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 62a8741..6f9985f 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -4535,16 +4535,14 @@ ephy_window_close (EphyWindow *window)
                return FALSE;
        }
 
-       if (g_settings_get_boolean (EPHY_SETTINGS_MAIN,
-                                   EPHY_PREFS_WARN_ON_CLOSE_UNSUBMITTED_DATA))
+       if (!window->priv->force_close &&
+           g_settings_get_boolean (EPHY_SETTINGS_MAIN,
+                                   EPHY_PREFS_WARN_ON_CLOSE_UNSUBMITTED_DATA) &&
+           gtk_notebook_get_n_pages (window->priv->notebook) > 0)
        {
-               if (!window->priv->force_close &&
-                   gtk_notebook_get_n_pages (window->priv->notebook) > 0)
-               {
-                       ephy_window_check_modified_forms (window);
-                       /* stop window close */
-                       return FALSE;
-               }
+               ephy_window_check_modified_forms (window);
+               /* stop window close */
+               return FALSE;
        }
 
        if (window_has_ongoing_downloads (window) && confirm_close_with_downloads (window) == FALSE)


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