evolution r37062 - branches/gnome-2-24/mail
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r37062 - branches/gnome-2-24/mail
- Date: Tue, 13 Jan 2009 03:41:08 +0000 (UTC)
Author: msuman
Date: Tue Jan 13 03:41:08 2009
New Revision: 37062
URL: http://svn.gnome.org/viewvc/evolution?rev=37062&view=rev
Log:
Patch from Felix Riemann <friemann svn gnome org> ** Fix for bug #563867 (Unescape "&" when passing the link to browsers).
Modified:
branches/gnome-2-24/mail/ChangeLog
branches/gnome-2-24/mail/em-folder-view.c
branches/gnome-2-24/mail/em-popup.c
branches/gnome-2-24/mail/em-utils.c
branches/gnome-2-24/mail/em-utils.h
Modified: branches/gnome-2-24/mail/em-folder-view.c
==============================================================================
--- branches/gnome-2-24/mail/em-folder-view.c (original)
+++ branches/gnome-2-24/mail/em-folder-view.c Tue Jan 13 03:41:08 2009
@@ -2743,37 +2743,6 @@
}
}
-static gchar *
-url_unescape_amp (const gchar *url)
-{
- gchar *buff;
- int i, j, amps;
-
- if (!url)
- return NULL;
-
- amps = 0;
- for (i = 0; url [i]; i++) {
- if (url [i] == '&' && strncmp (url + i, "&", 5) == 0)
- amps++;
- }
-
- buff = g_strdup (url);
-
- if (!amps)
- return buff;
-
- for (i = 0, j = 0; url [i]; i++, j++) {
- buff [j] = url [i];
-
- if (url [i] == '&' && strncmp (url + i, "&", 5) == 0)
- i += 4;
- }
- buff [j] = 0;
-
- return buff;
-}
-
static void
emp_uri_popup_link_copy(EPopup *ep, EPopupItem *pitem, void *data)
{
@@ -2781,7 +2750,7 @@
struct _EMFolderViewPrivate *p = emfv->priv;
g_free(p->selection_uri);
- p->selection_uri = url_unescape_amp(pitem->user_data);
+ p->selection_uri = em_utils_url_unescape_amp(pitem->user_data);
gtk_selection_owner_set(p->invisible, GDK_SELECTION_PRIMARY, gtk_get_current_event_time());
gtk_selection_owner_set(p->invisible, GDK_SELECTION_CLIPBOARD, gtk_get_current_event_time());
Modified: branches/gnome-2-24/mail/em-popup.c
==============================================================================
--- branches/gnome-2-24/mail/em-popup.c (original)
+++ branches/gnome-2-24/mail/em-popup.c Tue Jan 13 03:41:08 2009
@@ -588,12 +588,14 @@
{
EMPopupTargetURI *t = (EMPopupTargetURI *)ep->target;
GError *err = NULL;
+ gchar *unescaped_uri = em_utils_url_unescape_amp (t->uri);
- gnome_url_show(t->uri, &err);
+ gnome_url_show(unescaped_uri, &err);
if (err) {
g_warning("gnome_url_show: %s", err->message);
g_error_free(err);
}
+ g_free (unescaped_uri);
}
static void
Modified: branches/gnome-2-24/mail/em-utils.c
==============================================================================
--- branches/gnome-2-24/mail/em-utils.c (original)
+++ branches/gnome-2-24/mail/em-utils.c Tue Jan 13 03:41:08 2009
@@ -2442,3 +2442,34 @@
g_signal_connect(widget, "response", G_CALLBACK(error_response), NULL);
e_activity_handler_make_error (handler, "mail", E_LOG_WARNINGS, widget);
}
+
+gchar *
+em_utils_url_unescape_amp (const gchar *url)
+{
+ gchar *buff;
+ int i, j, amps;
+
+ if (!url)
+ return NULL;
+
+ amps = 0;
+ for (i = 0; url [i]; i++) {
+ if (url [i] == '&' && strncmp (url + i, "&", 5) == 0)
+ amps++;
+ }
+
+ buff = g_strdup (url);
+
+ if (!amps)
+ return buff;
+
+ for (i = 0, j = 0; url [i]; i++, j++) {
+ buff [j] = url [i];
+
+ if (url [i] == '&' && strncmp (url + i, "&", 5) == 0)
+ i += 4;
+ }
+ buff [j] = 0;
+
+ return buff;
+}
Modified: branches/gnome-2-24/mail/em-utils.h
==============================================================================
--- branches/gnome-2-24/mail/em-utils.h (original)
+++ branches/gnome-2-24/mail/em-utils.h Tue Jan 13 03:41:08 2009
@@ -117,6 +117,9 @@
/* clears flag 'get_password_canceled' at every known accounts, so if needed, get_password will show dialog */
void em_utils_clear_get_password_canceled_accounts_flag (void);
+/* Unescapes & back to a real & in URIs */
+gchar *em_utils_url_unescape_amp (const gchar *url);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]