aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-tab.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@src.gnome.org>2003-12-14 02:22:12 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-12-14 02:22:12 +0800
commit9b633f92abdd89bedd5b7bb9912bd8e78c68f021 (patch)
tree1755a1246db381d175773f9c45cf3e5234970596 /src/ephy-tab.c
parent60820903a87b48f1026786ef6cec0a9a8b39a7b9 (diff)
downloadgsoc2013-epiphany-9b633f92abdd89bedd5b7bb9912bd8e78c68f021.tar
gsoc2013-epiphany-9b633f92abdd89bedd5b7bb9912bd8e78c68f021.tar.gz
gsoc2013-epiphany-9b633f92abdd89bedd5b7bb9912bd8e78c68f021.tar.bz2
gsoc2013-epiphany-9b633f92abdd89bedd5b7bb9912bd8e78c68f021.tar.lz
gsoc2013-epiphany-9b633f92abdd89bedd5b7bb9912bd8e78c68f021.tar.xz
gsoc2013-epiphany-9b633f92abdd89bedd5b7bb9912bd8e78c68f021.tar.zst
gsoc2013-epiphany-9b633f92abdd89bedd5b7bb9912bd8e78c68f021.zip
*** empty log message ***
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r--src/ephy-tab.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 7a987c87a..fb4c26393 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -745,11 +745,11 @@ get_host_name_from_uri (const char *uri)
return result;
}
-static char *
-build_net_state_message (const char *uri, EmbedState flags)
+static void
+update_net_state_message (EphyTab *tab, const char *uri, EmbedState flags)
{
const char *msg = NULL;
- char *host, *message = NULL;
+ char *host;
host = get_host_name_from_uri (uri);
@@ -779,14 +779,22 @@ build_net_state_message (const char *uri, EmbedState flags)
}
}
- if (msg)
+ if ((flags & EMBED_STATE_IS_NETWORK) &&
+ (flags & EMBED_STATE_STOP))
+ {
+ g_free (tab->priv->status_message);
+ tab->priv->status_message = NULL;
+ g_object_notify (G_OBJECT (tab), "message");
+
+ }
+ else if (msg)
{
- message = g_strdup_printf (msg, host);
+ g_free (tab->priv->status_message);
+ tab->priv->status_message = g_strdup_printf (msg, host);
+ g_object_notify (G_OBJECT (tab), "message");
}
g_free (host);
-
- return message;
}
static void
@@ -833,16 +841,7 @@ static void
ephy_tab_net_state_cb (EphyEmbed *embed, const char *uri,
EmbedState state, EphyTab *tab)
{
- char *new_msg;
-
- new_msg = build_net_state_message (uri, state);
- if (tab->priv->status_message)
- {
- g_free (tab->priv->status_message);
- }
- tab->priv->status_message = new_msg;
-
- g_object_notify (G_OBJECT (tab), "message");
+ update_net_state_message (tab, uri, state);
if (state & EMBED_STATE_IS_NETWORK)
{