[epiphany] Don't show ephy-about: in the UI
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Don't show ephy-about: in the UI
- Date: Tue, 7 Jan 2014 23:08:42 +0000 (UTC)
commit e504fb8fbc94a467190db0526bbe165ca9b6d250
Author: William Jon McCann <william jon mccann gmail com>
Date: Sat Dec 21 06:25:35 2013 -0500
Don't show ephy-about: in the UI
https://bugzilla.gnome.org/show_bug.cgi?id=720876
lib/widgets/ephy-location-entry.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 883d7e5..04cc5d0 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -669,6 +669,19 @@ each_url_get_data_binder (EphyDragEachSelectedItemDataGet iteratee,
g_free (title);
}
+static void
+sanitize_location (char **url)
+{
+ char *str;
+
+ /* Do not show internal ephy-about: protocol to users */
+ if (g_str_has_prefix (*url, EPHY_ABOUT_SCHEME)) {
+ str = g_strdup_printf ("about:%s", *url + strlen (EPHY_ABOUT_SCHEME) + 1);
+ g_free (*url);
+ *url = str;
+ }
+}
+
#define DRAG_ICON_LAYOUT_PADDING 2
#define DRAG_ICON_ICON_PADDING 4
#define DRAG_ICON_MAX_WIDTH_CHARS 32
@@ -697,6 +710,7 @@ favicon_create_drag_surface (EphyLocationEntry *entry,
state = gtk_widget_get_state_flags (widget);
g_signal_emit (entry, signals[GET_LOCATION], 0, &address);
+ sanitize_location (&address);
g_signal_emit (entry, signals[GET_TITLE], 0, &title);
if (address == NULL || title == NULL) return NULL;
@@ -1061,12 +1075,7 @@ textcell_data_func (GtkCellLayout *cell_layout,
if (url)
{
- /* Do not show internal ephy-about: protocol to users */
- if (g_str_has_prefix (url, EPHY_ABOUT_SCHEME)) {
- g_free (url);
- url = g_strdup_printf ("about:%s", url + strlen (EPHY_ABOUT_SCHEME) + 1);
- }
-
+ sanitize_location (&url);
ctext = g_strdup_printf ("%s\n%s", title, url);
style = gtk_widget_get_style_context (entry);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]