From 91464eef94f05c139aa60fc8bebcc3e7fad62281 Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Wed, 28 Aug 2013 22:23:07 +0300 Subject: 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 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/ephy-window.c b/src/ephy-window.c index 62a874108..6f9985f15 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) -- cgit v1.2.3