aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-encodings.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-12-14 02:58:58 +0800
committerChristian Persch <chpe@src.gnome.org>2004-12-14 02:58:58 +0800
commit39dad59354eb6d7093c9f95817b5278de9f19982 (patch)
tree50b5ee15fcc46459a98c2267cdfef3712d32c369 /embed/ephy-encodings.c
parent43955b584199f99428660d47bc2a7297ffdf763f (diff)
downloadgsoc2013-epiphany-39dad59354eb6d7093c9f95817b5278de9f19982.tar
gsoc2013-epiphany-39dad59354eb6d7093c9f95817b5278de9f19982.tar.gz
gsoc2013-epiphany-39dad59354eb6d7093c9f95817b5278de9f19982.tar.bz2
gsoc2013-epiphany-39dad59354eb6d7093c9f95817b5278de9f19982.tar.lz
gsoc2013-epiphany-39dad59354eb6d7093c9f95817b5278de9f19982.tar.xz
gsoc2013-epiphany-39dad59354eb6d7093c9f95817b5278de9f19982.tar.zst
gsoc2013-epiphany-39dad59354eb6d7093c9f95817b5278de9f19982.zip
Get rid of ephy_string_[elide|double]_underscores(). Remove unnecessary
2004-12-13 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-encodings.c: (elide_underscores), (add_encoding): * embed/mozilla/FilePicker.cpp: * lib/ephy-dnd.c: * lib/ephy-node.c: * lib/ephy-string.c: (ephy_string_blank_chr): * lib/ephy-string.h: * lib/widgets/ephy-node-view.c: * src/ephy-encoding-menu.c: * src/ephy-notebook.c: * src/ephy-session.c: * src/ephy-statusbar.c: * src/ephy-tab.c: (ephy_tab_set_title): * src/ephy-tabs-menu.c: (connect_proxy_cb): * src/ppview-toolbar.c: Get rid of ephy_string_[elide|double]_underscores(). Remove unnecessary ephy-string.h includes.
Diffstat (limited to 'embed/ephy-encodings.c')
-rw-r--r--embed/ephy-encodings.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/embed/ephy-encodings.c b/embed/ephy-encodings.c
index 92557957b..ce8d87e90 100644
--- a/embed/ephy-encodings.c
+++ b/embed/ephy-encodings.c
@@ -22,7 +22,6 @@
#include "config.h"
#include "ephy-encodings.h"
-#include "ephy-string.h"
#include "ephy-node-db.h"
#include "ephy-file-helpers.h"
#include "eel-gconf-extensions.h"
@@ -230,6 +229,35 @@ ephy_encodings_class_init (EphyEncodingsClass *klass)
g_type_class_add_private (object_class, sizeof (EphyEncodingsPrivate));
}
+/* copied from egg-toolbar-editor.c */
+static char *
+elide_underscores (const char *original)
+{
+ char *q, *result;
+ const char *p;
+ gboolean last_underscore;
+
+ q = result = g_malloc (strlen (original) + 1);
+ last_underscore = FALSE;
+
+ for (p = original; *p; p++)
+ {
+ if (!last_underscore && *p == '_')
+ {
+ last_underscore = TRUE;
+ }
+ else
+ {
+ last_underscore = FALSE;
+ *q++ = *p;
+ }
+ }
+
+ *q = '\0';
+
+ return result;
+}
+
static EphyNode *
add_encoding (EphyEncodings *encodings,
const char *title,
@@ -248,7 +276,7 @@ add_encoding (EphyEncodings *encodings,
ephy_node_set_property (node, EPHY_NODE_ENCODING_PROP_TITLE, &value);
g_value_unset (&value);
- elided = ephy_string_elide_underscores (title);
+ elided = elide_underscores (title);
normalised = g_utf8_normalize (elided, -1, G_NORMALIZE_DEFAULT);
g_value_init (&value, G_TYPE_STRING);