aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-tab.c
diff options
context:
space:
mode:
authorChristian Persch <chpe+gnomebugz@stud.uni-saarland.de>2003-05-05 02:44:40 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-05 02:44:40 +0800
commit7bb7ee7a2460eee1496c6b5e51db09007f7809b1 (patch)
tree1cbb7932925db9146768a5537df5e15495b64c05 /src/ephy-tab.c
parentffe15a896a6714ad23c013eaeefd49671f7fbc47 (diff)
downloadgsoc2013-epiphany-7bb7ee7a2460eee1496c6b5e51db09007f7809b1.tar.gz
gsoc2013-epiphany-7bb7ee7a2460eee1496c6b5e51db09007f7809b1.tar.zst
gsoc2013-epiphany-7bb7ee7a2460eee1496c6b5e51db09007f7809b1.zip
Use uri as title when the page is untitled.
2003-05-04 Christian Persch <chpe+gnomebugz@stud.uni-saarland.de> * src/ephy-tab.c: (ephy_tab_title_cb): Use uri as title when the page is untitled.
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r--src/ephy-tab.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 6f2848a33..1c6800283 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -570,13 +570,33 @@ ephy_tab_set_title (EphyTab *tab, const char *title)
static void
ephy_tab_title_cb (EphyEmbed *embed, EphyTab *tab)
{
+ GnomeVFSURI *uri;
+
if (tab->priv->title) g_free (tab->priv->title);
ephy_embed_get_title (embed, &tab->priv->title);
if (*(tab->priv->title) == '\0')
{
g_free (tab->priv->title);
- tab->priv->title = g_strdup (_("Untitled"));
+ tab->priv->title = NULL;
+
+ uri = gnome_vfs_uri_new (tab->priv->location);
+ if (uri)
+ {
+ tab->priv->title = gnome_vfs_uri_to_string (uri,
+ GNOME_VFS_URI_HIDE_USER_NAME |
+ GNOME_VFS_URI_HIDE_PASSWORD |
+ GNOME_VFS_URI_HIDE_HOST_PORT |
+ GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD |
+ GNOME_VFS_URI_HIDE_FRAGMENT_IDENTIFIER);
+ gnome_vfs_uri_unref (uri);
+ }
+
+ if (tab->priv->title == NULL || *(tab->priv->title) == '\0')
+ {
+ g_free (tab->priv->title);
+ tab->priv->title = g_strdup (_("Blank page"));
+ }
}
ephy_tab_set_title (tab, tab->priv->title);