aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-10-10 20:48:49 +0800
committerChristian Persch <chpe@src.gnome.org>2005-10-10 20:48:49 +0800
commitc42c18f05cccabccd3b812f2ddf768d166db259c (patch)
tree5cff27d0e00fc4b886bb9148a4c30f226b433b9a /src
parentd22a95c092b87ad574dadaa91167912a963aa528 (diff)
downloadgsoc2013-epiphany-c42c18f05cccabccd3b812f2ddf768d166db259c.tar
gsoc2013-epiphany-c42c18f05cccabccd3b812f2ddf768d166db259c.tar.gz
gsoc2013-epiphany-c42c18f05cccabccd3b812f2ddf768d166db259c.tar.bz2
gsoc2013-epiphany-c42c18f05cccabccd3b812f2ddf768d166db259c.tar.lz
gsoc2013-epiphany-c42c18f05cccabccd3b812f2ddf768d166db259c.tar.xz
gsoc2013-epiphany-c42c18f05cccabccd3b812f2ddf768d166db259c.tar.zst
gsoc2013-epiphany-c42c18f05cccabccd3b812f2ddf768d166db259c.zip
Bring back ephy_string_shorten.
2005-10-10 Christian Persch <chpe@cvs.gnome.org> * lib/ephy-string.c: (ephy_string_blank_chr), (ephy_string_shorten): * lib/ephy-string.h: Bring back ephy_string_shorten. * src/ephy-tab.c: (ephy_tab_file_monitor_cb), (ephy_tab_set_title): Shorten overlong tab titles, hard. Increase reload delay slightly. Strip whitespace from tab title before determining if it's empty.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-tab.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 4d7faeff4..b18f971bc 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -70,7 +70,9 @@
#define EPHY_TAB_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_TAB, EphyTabPrivate))
-#define MAX_HIDDEN_POPUPS 5
+#define MAX_HIDDEN_POPUPS 5
+#define RELOAD_DELAY 250 /* ms */
+#define MAX_TITLE_LENGTH 512 /* characters */
struct _EphyTabPrivate
{
@@ -1312,7 +1314,7 @@ ephy_tab_file_monitor_cb (GnomeVFSMonitorHandle *handle,
}
priv->reload_scheduled_id =
- g_timeout_add (100 /* ms */,
+ g_timeout_add (RELOAD_DELAY,
(GSourceFunc) ephy_file_monitor_reload_cb,
tab);
break;
@@ -2175,7 +2177,7 @@ ephy_tab_set_title (EphyTab *tab,
{
EphyTabPrivate *priv = tab->priv;
- if (!priv->is_blank && (title == NULL || title[0] == '\0'))
+ if (!priv->is_blank && (title == NULL || g_strstrip (title)[0] == '\0'))
{
g_free (title);
@@ -2189,9 +2191,14 @@ ephy_tab_set_title (EphyTab *tab,
priv->is_blank = TRUE;
}
}
+ else if (priv->is_blank && title != NULL)
+ {
+ g_free (title);
+ title = NULL;
+ }
g_free (priv->title);
- priv->title = title;
+ priv->title = ephy_string_shorten (title, MAX_TITLE_LENGTH);
g_object_notify (G_OBJECT (tab), "title");
}