diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-12-14 02:58:58 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-12-14 02:58:58 +0800 |
commit | 39dad59354eb6d7093c9f95817b5278de9f19982 (patch) | |
tree | 50b5ee15fcc46459a98c2267cdfef3712d32c369 | |
parent | 43955b584199f99428660d47bc2a7297ffdf763f (diff) | |
download | gsoc2013-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.
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | embed/ephy-encodings.c | 32 | ||||
-rw-r--r-- | embed/mozilla/FilePicker.cpp | 1 | ||||
-rw-r--r-- | lib/ephy-dnd.c | 1 | ||||
-rw-r--r-- | lib/ephy-node.c | 1 | ||||
-rw-r--r-- | lib/ephy-string.c | 67 | ||||
-rw-r--r-- | lib/ephy-string.h | 4 | ||||
-rw-r--r-- | lib/widgets/ephy-node-view.c | 3 | ||||
-rw-r--r-- | src/ephy-encoding-menu.c | 1 | ||||
-rw-r--r-- | src/ephy-notebook.c | 1 | ||||
-rw-r--r-- | src/ephy-session.c | 1 | ||||
-rwxr-xr-x | src/ephy-statusbar.c | 1 | ||||
-rw-r--r-- | src/ephy-tab.c | 8 | ||||
-rw-r--r-- | src/ephy-tabs-menu.c | 12 | ||||
-rwxr-xr-x | src/ppview-toolbar.c | 1 |
15 files changed, 61 insertions, 93 deletions
@@ -1,5 +1,25 @@ 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. + +2004-12-13 Christian Persch <chpe@cvs.gnome.org> + * Makefile.am: Make distcheck fix. 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); diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp index 88825d0a9..049f690bf 100644 --- a/embed/mozilla/FilePicker.cpp +++ b/embed/mozilla/FilePicker.cpp @@ -42,7 +42,6 @@ #include <nsIDOMWindowInternal.h> #endif -#include "ephy-string.h" #include "ephy-prefs.h" #include "ephy-gui.h" #include "ephy-debug.h" diff --git a/lib/ephy-dnd.c b/lib/ephy-dnd.c index 6ff9cff16..68510d85f 100644 --- a/lib/ephy-dnd.c +++ b/lib/ephy-dnd.c @@ -21,7 +21,6 @@ #include "config.h" #include "ephy-dnd.h" -#include "ephy-string.h" #include "ephy-node.h" #include <gtk/gtkselection.h> diff --git a/lib/ephy-node.c b/lib/ephy-node.c index 1a8e53292..1be64cb21 100644 --- a/lib/ephy-node.c +++ b/lib/ephy-node.c @@ -31,7 +31,6 @@ #include <time.h> #include "ephy-node.h" -#include "ephy-string.h" typedef struct { diff --git a/lib/ephy-string.c b/lib/ephy-string.c index da89dd2c5..2d53c25b5 100644 --- a/lib/ephy-string.c +++ b/lib/ephy-string.c @@ -85,70 +85,3 @@ ephy_string_blank_chr (char *source) return source; } - -/* copied from egg-toolbar-editor.c */ -char * -ephy_string_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; -} - -char * -ephy_string_double_underscores (const char *string) -{ - int underscores; - const char *p; - char *q; - char *escaped; - - if (string == NULL) - { - return NULL; - } - - underscores = 0; - for (p = string; *p != '\0'; p++) - { - underscores += (*p == '_'); - } - - if (underscores == 0) - { - return g_strdup (string); - } - - escaped = g_new (char, strlen (string) + underscores + 1); - for (p = string, q = escaped; *p != '\0'; p++, q++) - { - /* Add an extra underscore. */ - if (*p == '_') { - *q++ = '_'; - } - *q = *p; - } - *q = '\0'; - - return escaped; -} diff --git a/lib/ephy-string.h b/lib/ephy-string.h index 886bca5dc..36e23d1c3 100644 --- a/lib/ephy-string.h +++ b/lib/ephy-string.h @@ -30,10 +30,6 @@ gboolean ephy_string_to_int (const char *string, char *ephy_string_blank_chr (char *source); -char *ephy_string_elide_underscores (const char *original); - -char *ephy_string_double_underscores (const char *string); - G_END_DECLS #endif diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index 2f3df35e7..c0e34b62a 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -36,8 +36,7 @@ #include "ephy-dnd.h" #include "ephy-gui.h" #include "ephy-marshal.h" -#include "ephy-string.h" -#include "string.h" +#include <string.h> static void ephy_node_view_class_init (EphyNodeViewClass *klass); static void ephy_node_view_init (EphyNodeView *view); diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c index 2f5ab540e..9a31a0006 100644 --- a/src/ephy-encoding-menu.c +++ b/src/ephy-encoding-menu.c @@ -28,7 +28,6 @@ #include "ephy-embed.h" #include "ephy-embed-shell.h" #include "ephy-shell.h" -#include "ephy-string.h" #include "ephy-debug.h" #include <gtk/gtkaction.h> diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index b4d62a3f9..e37e3cb7f 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -35,7 +35,6 @@ #include "ephy-debug.h" #include "ephy-favicon-cache.h" #include "ephy-spinner.h" -#include "ephy-string.h" #include <glib-object.h> #include <gtk/gtkeventbox.h> diff --git a/src/ephy-session.c b/src/ephy-session.c index 31346004b..daf8a458f 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -29,7 +29,6 @@ #include "ephy-shell.h" #include "ephy-history-window.h" #include "ephy-bookmarks-editor.h" -#include "ephy-string.h" #include "ephy-file-helpers.h" #include "eel-gconf-extensions.h" #include "ephy-prefs.h" diff --git a/src/ephy-statusbar.c b/src/ephy-statusbar.c index 5491ea54f..b286242bc 100755 --- a/src/ephy-statusbar.c +++ b/src/ephy-statusbar.c @@ -24,7 +24,6 @@ #include "ephy-statusbar.h" #include "ephy-stock-icons.h" -#include "ephy-string.h" #include <string.h> #include <gtk/gtkprogressbar.h> diff --git a/src/ephy-tab.c b/src/ephy-tab.c index f9314f4c2..f6e20e6d4 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -1748,7 +1748,7 @@ ephy_tab_get_status_message (EphyTab *tab) static void ephy_tab_set_title (EphyTab *tab, EphyEmbed *embed, const char *new_title) { - char *title_tmp, *title = NULL; + char *title = NULL; g_return_if_fail (EPHY_IS_TAB (tab)); @@ -1796,14 +1796,10 @@ ephy_tab_set_title (EphyTab *tab, EphyEmbed *embed, const char *new_title) tab->priv->title = title; - title_tmp = ephy_string_double_underscores (title); - g_object_set (G_OBJECT (tab->priv->action), - "label", title_tmp, + "label", title, NULL); - g_free (title_tmp); - g_object_notify (G_OBJECT (tab), "title"); } diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c index c207f4c95..64b553ec8 100644 --- a/src/ephy-tabs-menu.c +++ b/src/ephy-tabs-menu.c @@ -22,7 +22,6 @@ #include "config.h" #include "ephy-tabs-menu.h" -#include "ephy-string.h" #include "ephy-marshal.h" #include "ephy-shell.h" #include "ephy-debug.h" @@ -37,7 +36,7 @@ #include <stdlib.h> #include <libxml/entities.h> -#define MAX_LABEL_LENGTH 30 +#define LABEL_WIDTH_CHARS 32 #define EPHY_TABS_MENU_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_TABS_MENU, EphyTabsMenuPrivate)) @@ -131,8 +130,13 @@ connect_proxy_cb (GtkActionGroup *action_group, { if (GTK_IS_MENU_ITEM (proxy)) { - gtk_label_set_ellipsize (GTK_LABEL (GTK_BIN (proxy)->child), - PANGO_ELLIPSIZE_END); + GtkLabel *label; + + label = GTK_LABEL (GTK_BIN (proxy)->child); + + gtk_label_set_use_underline (label, FALSE); + gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END); + gtk_label_set_max_width_chars (label, LABEL_WIDTH_CHARS); } } diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c index 2474205f8..9b2e6824b 100755 --- a/src/ppview-toolbar.c +++ b/src/ppview-toolbar.c @@ -22,7 +22,6 @@ #include "ppview-toolbar.h" #include "ephy-window.h" -#include "ephy-string.h" #include <string.h> #include <glib/gi18n.h> |