aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorJulian de Navascues <julian.navascues@gmail.com>2009-09-01 16:34:32 +0800
committerXan Lopez <xan@gnome.org>2009-09-01 19:41:41 +0800
commit3e3467417376d7e756905da9faf8335d89decd62 (patch)
tree66d6bc17f9ce4e55a6e5bbd8ce5a5c2eddf7a07a /src/ephy-shell.c
parent71f95a25b2a9e03e6ce6372788c287ff26d20956 (diff)
downloadgsoc2013-epiphany-3e3467417376d7e756905da9faf8335d89decd62.tar.gz
gsoc2013-epiphany-3e3467417376d7e756905da9faf8335d89decd62.tar.zst
gsoc2013-epiphany-3e3467417376d7e756905da9faf8335d89decd62.zip
Fixs the warning if using NULL url
If ephy_shell_new_tab receives a NULL url it passes it to ephy_shell_new_tab_full instead of always building a request with the url Also, in ephy_shell_new_tab_full checks that if OPEN_PAGE flag is enabled, request must be non NULL. Bug #593701 Signed-off-by: Xan Lopez <xan@gnome.org>
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index e6b56d376..0d37e609f 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright © 2000-2004 Marco Pesenti Gritti
* Copyright © 2003, 2004, 2006 Christian Persch
@@ -431,6 +432,7 @@ ephy_shell_new_tab_full (EphyShell *shell,
EphyWindow *window;
EphyEmbed *embed = NULL;
gboolean in_new_window = TRUE;
+ gboolean open_page = FALSE;
gboolean jump_to;
gboolean active_is_blank = FALSE;
GtkWidget *nb;
@@ -438,11 +440,13 @@ ephy_shell_new_tab_full (EphyShell *shell,
gboolean is_empty = FALSE;
EphyToolbar *toolbar;
+ if (flags & EPHY_NEW_TAB_OPEN_PAGE) open_page = TRUE;
if (flags & EPHY_NEW_TAB_IN_NEW_WINDOW) in_new_window = TRUE;
if (flags & EPHY_NEW_TAB_IN_EXISTING_WINDOW) in_new_window = FALSE;
in_new_window = in_new_window && !eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN);
g_return_val_if_fail (in_new_window || !is_popup, NULL);
+ g_return_val_if_fail (open_page == (gboolean)(request != NULL), NULL);
jump_to = (flags & EPHY_NEW_TAB_JUMP) != 0;
@@ -568,12 +572,14 @@ ephy_shell_new_tab (EphyShell *shell,
EphyNewTabFlags flags)
{
EphyEmbed *embed;
- WebKitNetworkRequest *request = webkit_network_request_new (url);
+ WebKitNetworkRequest *request = url ? webkit_network_request_new (url) : NULL;
embed = ephy_shell_new_tab_full (shell, parent_window,
previous_embed, request, flags,
EPHY_WEB_VIEW_CHROME_ALL, FALSE, 0);
- g_object_unref (request);
+
+ if (request)
+ g_object_unref (request);
return embed;
}