diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-12-14 01:57:12 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-12-14 01:57:12 +0800 |
commit | 43955b584199f99428660d47bc2a7297ffdf763f (patch) | |
tree | 8fe84b888fa2e1cdef16d27fbf3049d164f09ae4 /lib | |
parent | f58beaee60ebf176074bcad300c5e7ac0e253694 (diff) | |
download | gsoc2013-epiphany-43955b584199f99428660d47bc2a7297ffdf763f.tar.gz gsoc2013-epiphany-43955b584199f99428660d47bc2a7297ffdf763f.tar.zst gsoc2013-epiphany-43955b584199f99428660d47bc2a7297ffdf763f.zip |
Make distcheck fix.
2004-12-13 Christian Persch <chpe@cvs.gnome.org>
* Makefile.am:
Make distcheck fix.
* lib/ephy-string.c:
* lib/ephy-string.h:
Finally remove ephy_string_shorten().
* src/bookmarks/ephy-bookmark-action.c: (create_tool_item),
(ephy_bookmark_action_sync_label):
* src/bookmarks/ephy-bookmarks-menu.c: (connect_proxy_cb):
* src/bookmarks/ephy-favorites-menu.c: (connect_proxy_cb):
* src/bookmarks/ephy-topic-action.c: (create_tool_item),
(ephy_topic_action_sync_label), (append_bookmarks_menu),
(build_topics_menu):
* src/ephy-navigation-action.c: (new_history_menu_item):
Use gtk_label_set_max_width_chars() and ellipsise the labels.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-string.c | 37 | ||||
-rw-r--r-- | lib/ephy-string.h | 3 |
2 files changed, 0 insertions, 40 deletions
diff --git a/lib/ephy-string.c b/lib/ephy-string.c index e3095c376..da89dd2c5 100644 --- a/lib/ephy-string.c +++ b/lib/ephy-string.c @@ -27,43 +27,6 @@ #include <stdlib.h> #include <glib.h> -#define ELLIPSIS "\xe2\x80\xa6" - -/** - * ephy_string_shorten: returns a newly allocated shortened version of str. - * The input must be valid utf-8. - * @str: the string to shorten - * @target_length: the length of the shortened string (in characters) - * - * FIXME: this function is a big mess. While it is utf-8 safe now, - * it can still split a sequence of combining characters - */ -char * -ephy_string_shorten (const char *str, int target_length) -{ - char *new_str; - glong actual_length; - gulong bytes; - - if (!str) return NULL; - - actual_length = g_utf8_strlen (str, -1); - - /* if the string is already short enough, or if it's too short for - * us to shorten it, return a new copy */ - if (actual_length <= target_length) return g_strdup (str); - - /* create string */ - bytes = GPOINTER_TO_UINT (g_utf8_offset_to_pointer (str, target_length - 1) - str); - - new_str = g_new0 (gchar, bytes + strlen(ELLIPSIS) + 1); - - strncpy (new_str, str, bytes); - strncpy (new_str + bytes, ELLIPSIS, strlen (ELLIPSIS)); - - return new_str; -} - gboolean ephy_string_to_int (const char *string, gulong *integer) { diff --git a/lib/ephy-string.h b/lib/ephy-string.h index f2907219f..886bca5dc 100644 --- a/lib/ephy-string.h +++ b/lib/ephy-string.h @@ -30,9 +30,6 @@ gboolean ephy_string_to_int (const char *string, char *ephy_string_blank_chr (char *source); -char *ephy_string_shorten (const char *str, - int target_length); - char *ephy_string_elide_underscores (const char *original); char *ephy_string_double_underscores (const char *string); |