diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-11-21 21:56:32 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-11-21 21:56:32 +0800 |
commit | 89e91e1b9afb5e66241f39eaf0c21f8444198758 (patch) | |
tree | d3393547e5de968f8cf4d77ecf055faa7d509658 /src/ephy-tab.c | |
parent | e2aa41afe7aaf0d856645551ceb30601062c5b79 (diff) | |
download | gsoc2013-epiphany-89e91e1b9afb5e66241f39eaf0c21f8444198758.tar gsoc2013-epiphany-89e91e1b9afb5e66241f39eaf0c21f8444198758.tar.gz gsoc2013-epiphany-89e91e1b9afb5e66241f39eaf0c21f8444198758.tar.bz2 gsoc2013-epiphany-89e91e1b9afb5e66241f39eaf0c21f8444198758.tar.lz gsoc2013-epiphany-89e91e1b9afb5e66241f39eaf0c21f8444198758.tar.xz gsoc2013-epiphany-89e91e1b9afb5e66241f39eaf0c21f8444198758.tar.zst gsoc2013-epiphany-89e91e1b9afb5e66241f39eaf0c21f8444198758.zip |
Fix generic 'site' hostname fallback. Fixes bug #155442.
2004-11-21 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-tab.c: (update_net_state_message):
Fix generic 'site' hostname fallback. Fixes bug #155442.
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r-- | src/ephy-tab.c | 75 |
1 files changed, 30 insertions, 45 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c index b543a60e8..f9314f4c2 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -1119,85 +1119,70 @@ build_load_percent (int requests_done, int requests_total) return percent; } -static char * -get_host_name_from_uri (const char *uri) +static void +update_net_state_message (EphyTab *tab, const char *uri, EmbedState flags) { GnomeVFSURI *vfs_uri = NULL; + const char *msg = NULL; const char *host = NULL; - char *result; - if (uri) + if (uri != NULL) { vfs_uri = gnome_vfs_uri_new (uri); } - if (vfs_uri) + if (vfs_uri != NULL) { host = gnome_vfs_uri_get_host_name (vfs_uri); } - if (!host) - { - host = _("site"); - } - - result = g_strdup (host); - - if (vfs_uri) gnome_vfs_uri_unref (vfs_uri); - - return result; -} - -static void -update_net_state_message (EphyTab *tab, const char *uri, EmbedState flags) -{ - const char *msg = NULL; - char *host; - - host = get_host_name_from_uri (uri); + if (host == NULL || host[0] == '\0') goto out; /* IS_REQUEST and IS_NETWORK can be both set */ - if (flags & EMBED_STATE_IS_REQUEST) - { - if (flags & EMBED_STATE_REDIRECTING) - { + { + if (flags & EMBED_STATE_REDIRECTING) + { msg = _("Redirecting to %s..."); - } - else if (flags & EMBED_STATE_TRANSFERRING) - { + } + else if (flags & EMBED_STATE_TRANSFERRING) + { msg = _("Transferring data from %s..."); - } - else if (flags & EMBED_STATE_NEGOTIATING) - { + } + else if (flags & EMBED_STATE_NEGOTIATING) + { msg = _("Waiting for authorization from %s..."); - } - } + } + } if (flags & EMBED_STATE_IS_NETWORK) - { - if (flags & EMBED_STATE_START) - { - msg = _("Loading %s..."); - } - } + { + if (flags & EMBED_STATE_START) + { + msg = _("Loading %s..."); + } + } 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) + else if (msg != NULL) { 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); +out: + if (vfs_uri != NULL) + { + gnome_vfs_uri_unref (vfs_uri); + } } static void |