Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > by-pkgid > 3d66a57dff168939b187ce97314ec8b5 > files > 5

evolution-2.28.2-1mdv2010.0.src.rpm

From 794efcbda8d47fe266f762c8f4358a6d3444050a Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Tue, 15 Dec 2009 11:36:21 +0100
Subject: [PATCH 01/16] Bug #250046 - Do not count Post To addresses when not shown

This is just a part of the above mentioned bug, the part which allows
notification to user that he/she didn't fill any recipient.
---
 mail/em-composer-utils.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 2586e91..71c75c1 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -265,10 +265,10 @@ composer_get_message (EMsgComposer *composer, gboolean save_html_object_data)
 	GConfClient *gconf;
 	EAccount *account;
 	gint i;
-	GList *postlist;
 	EMEvent *eme;
 	EMEventTargetComposer *target;
 	EComposerHeaderTable *table;
+	EComposerHeader *post_to_header;
 
 	gconf = mail_config_get_gconf_client ();
 	table = e_msg_composer_get_header_table (composer);
@@ -322,10 +322,15 @@ composer_get_message (EMsgComposer *composer, gboolean save_html_object_data)
 
 	camel_object_unref (cia);
 
-	postlist = e_composer_header_table_get_post_to (table);
-	num_post = g_list_length(postlist);
-	g_list_foreach(postlist, (GFunc)g_free, NULL);
-	g_list_free(postlist);
+	post_to_header = e_composer_header_table_get_header (table, E_COMPOSER_HEADER_POST_TO);
+	if (e_composer_header_get_visible (post_to_header)) {
+		GList *postlist;
+
+		postlist = e_composer_header_table_get_post_to (table);
+		num_post = g_list_length (postlist);
+		g_list_foreach (postlist, (GFunc)g_free, NULL);
+		g_list_free (postlist);
+	}
 
 	/* I'm sensing a lack of love, er, I mean recipients. */
 	if (num == 0 && num_post == 0) {
-- 
1.6.6


From a1bd2232d51388f64b4be8cff970a85aaa2bffb9 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Wed, 23 Dec 2009 11:12:44 +0100
Subject: [PATCH 05/16] Bug #595501 - Crash on a changed mail filter action removal

---
 mail/em-filter-rule.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c
index 47c5e4d..bb51cf0 100644
--- a/mail/em-filter-rule.c
+++ b/mail/em-filter-rule.c
@@ -373,6 +373,9 @@ get_rule_part_widget(EMFilterContext *f, FilterPart *newpart, FilterRule *fr)
 	data->part = newpart;
 
 	hbox = gtk_hbox_new(FALSE, 0);
+	/* only set to automatically clean up the memory and for less_parts */
+	g_object_set_data_full ((GObject *) hbox, "data", data, g_free);
+
 	p = filter_part_get_widget(newpart);
 
 	data->partwidget = p;
@@ -412,6 +415,7 @@ less_parts(GtkWidget *button, struct _rule_data *data)
 {
 	FilterPart *part;
 	GtkWidget *rule;
+	struct _part_data *part_data;
 	GList *l;
 
 	l =((EMFilterRule *)data->fr)->actions;
@@ -419,7 +423,11 @@ less_parts(GtkWidget *button, struct _rule_data *data)
 		return;
 
 	rule = g_object_get_data((GObject *)button, "rule");
-	part = g_object_get_data((GObject *)rule, "part");
+	part_data = g_object_get_data ((GObject *) rule, "data");
+
+	g_return_if_fail (part_data != NULL);
+
+	part = part_data->part;
 
 	/* remove the part from the list */
 	em_filter_rule_remove_action((EMFilterRule *)data->fr, part);
@@ -440,7 +448,6 @@ attach_rule(GtkWidget *rule, struct _rule_data *data, FilterPart *part, gint row
 
 	remove = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
 	g_object_set_data((GObject *)remove, "rule", rule);
-	g_object_set_data((GObject *)rule, "part", part);
 	/*gtk_button_set_relief(GTK_BUTTON(remove), GTK_RELIEF_NONE);*/
 	g_signal_connect(remove, "clicked", G_CALLBACK(less_parts), data);
 	gtk_table_attach(GTK_TABLE(data->parts), remove, 1, 2, row, row + 1,
@@ -544,6 +551,9 @@ get_widget(FilterRule *fr, RuleContext *rc)
 	data->fr = fr;
 	data->parts = parts;
 
+	/* only set to automatically clean up the memory */
+	g_object_set_data_full ((GObject *) hbox, "data", data, g_free);
+
 	hbox = gtk_hbox_new(FALSE, 3);
 
 	add = gtk_button_new_with_mnemonic (_("Add Ac_tion"));
-- 
1.6.6


From a4dbd5a2251516fe1b64ff2faf9d69cfa9b018f1 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Wed, 6 Jan 2010 13:37:25 +0100
Subject: [PATCH 08/16] Bug #549988 - "Empty Trash" in Trash popup empties all Trash folders

---
 mail/em-folder-tree.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index fabd89b..eb3d225 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -2062,7 +2062,12 @@ emft_popup_flush_outbox (EPopup *ep, EPopupItem *pitem, gpointer data)
 static void
 emft_popup_empty_trash (EPopup *ep, EPopupItem *pitem, gpointer data)
 {
-	em_utils_empty_trash (data);
+	EMFolderTree *emft = data;
+	CamelFolder *folder;
+
+	if ((folder = em_folder_tree_get_selected_folder (emft)) != NULL) {
+		em_utils_expunge_folder (gtk_widget_get_toplevel ((GtkWidget *)emft), folder);
+	}
 }
 
 static void
-- 
1.6.6


From 4aae323f2db2b3106376fb1b5f09e24e960f6763 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Thu, 7 Jan 2010 21:02:16 +0100
Subject: [PATCH 10/16] Bug #606340 - Crash on non-utf8 letter in mail folder name

---
 widgets/misc/e-info-label.c |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/widgets/misc/e-info-label.c b/widgets/misc/e-info-label.c
index 3333d47..31d7da8 100644
--- a/widgets/misc/e-info-label.c
+++ b/widgets/misc/e-info-label.c
@@ -194,6 +194,23 @@ e_info_label_new(const gchar *icon)
 	return (GtkWidget *)el;
 }
 
+static gchar *
+ensure_utf8 (const gchar *text)
+{
+	gchar *res = g_strdup (text), *p;
+
+	if (!text)
+		return res;
+
+	p = res;
+	while (!g_utf8_validate (p, -1, (const gchar **) &p)) {
+		/* make all invalid characters appear as question marks */
+		*p = '?';
+	}
+
+	return res;
+}
+
 /**
  * e_info_label_set_info:
  * @el:
@@ -210,6 +227,7 @@ void
 e_info_label_set_info(EInfoLabel *el, const gchar *location, const gchar *info)
 {
 	gchar *markup;
+	gchar *tmp;
 
 	if (el->location == NULL) {
 		el->location = gtk_label_new (NULL);
@@ -235,12 +253,15 @@ e_info_label_set_info(EInfoLabel *el, const gchar *location, const gchar *info)
 		gtk_widget_set_state (GTK_WIDGET (el), GTK_STATE_ACTIVE);
 	}
 
-	markup = g_markup_printf_escaped ("<b>%s</b>", location);
+	tmp = ensure_utf8 (location);
+	markup = g_markup_printf_escaped ("<b>%s</b>", tmp);
 	gtk_label_set_markup (GTK_LABEL (el->location), markup);
 	g_free (markup);
+	g_free (tmp);
 
-	markup = g_markup_printf_escaped ("<small>%s</small>", info);
+	tmp = ensure_utf8 (info);
+	markup = g_markup_printf_escaped ("<small>%s</small>", tmp);
 	gtk_label_set_markup (GTK_LABEL (el->info), markup);
 	g_free (markup);
+	g_free (tmp);
 }
-
-- 
1.6.6


From 499b0ef94e4f128018c76bb86b0f76203f302458 Mon Sep 17 00:00:00 2001
From: Thomas Mittelstaedt <tmstaedt@t-mittelstaedt.de>
Date: Fri, 8 Jan 2010 16:41:27 +0100
Subject: [PATCH 11/16] Bug #565582 - Make sure the comp_data is not NULL before using it

---
 calendar/gui/e-cal-menu.c  |    6 +++---
 calendar/gui/e-cal-popup.c |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/calendar/gui/e-cal-menu.c b/calendar/gui/e-cal-menu.c
index 30d287f..0d8c579 100644
--- a/calendar/gui/e-cal-menu.c
+++ b/calendar/gui/e-cal-menu.c
@@ -121,8 +121,9 @@ e_cal_menu_target_new_select(ECalMenu *eabp, struct _ECalModel *model, GPtrArray
 {
 	ECalMenuTargetSelect *t = e_menu_target_new(&eabp->menu, E_CAL_MENU_TARGET_SELECT, sizeof(*t));
 	guint32 mask = ~0;
-	ECal *client;
+	ECal *client = NULL;
 	gboolean read_only;
+	ECalModelComponent *comp_data = NULL;
 
 	/* FIXME: This is duplicated in e-cal-popup */
 
@@ -132,8 +133,7 @@ e_cal_menu_target_new_select(ECalMenu *eabp, struct _ECalModel *model, GPtrArray
 
 	if (t->events->len == 0) {
 		client = e_cal_model_get_default_client(t->model);
-	} else {
-		ECalModelComponent *comp_data = (ECalModelComponent *)t->events->pdata[0];
+	} else if ((comp_data = (ECalModelComponent *)t->events->pdata[0]) != NULL) {
 
 		mask &= ~E_CAL_MENU_SELECT_ANY;
 		if (t->events->len == 1)
diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c
index cdbce07..94f4242 100644
--- a/calendar/gui/e-cal-popup.c
+++ b/calendar/gui/e-cal-popup.c
@@ -219,8 +219,9 @@ e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArr
 {
 	ECalPopupTargetSelect *t = e_popup_target_new(&eabp->popup, E_CAL_POPUP_TARGET_SELECT, sizeof(*t));
 	guint32 mask = ~0;
-	ECal *client;
+	ECal *client = NULL;
 	gboolean read_only, user_org = FALSE;
+	ECalModelComponent *comp_data = NULL;
 
 	/* FIXME: This is duplicated in e-cal-menu */
 
@@ -230,8 +231,7 @@ e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArr
 
 	if (t->events->len == 0) {
 		client = e_cal_model_get_default_client(t->model);
-	} else {
-		ECalModelComponent *comp_data = (ECalModelComponent *)t->events->pdata[0];
+	} else if ((comp_data = (ECalModelComponent *)t->events->pdata[0]) != NULL) {
 		ECalComponent *comp;
 		gchar *user_email = NULL;
 
-- 
1.6.6


From d09447895d0b5aec761bfcbb739eb35b95b55fb9 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Fri, 8 Jan 2010 17:40:26 +0100
Subject: [PATCH 12/16] Bug #605600 - Meeting reminders with wrong times

---
 calendar/gui/alarm-notify/config-data.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c
index db23229..a55a9dd 100644
--- a/calendar/gui/alarm-notify/config-data.c
+++ b/calendar/gui/alarm-notify/config-data.c
@@ -209,9 +209,11 @@ config_data_get_timezone (void)
 
 	ensure_inited ();
 
-	location = gconf_client_get_string (conf_client,
-					    "/apps/evolution/calendar/display/timezone",
-					    NULL);
+	if (gconf_client_get_bool (conf_client, "/apps/evolution/calendar/display/use_system_timezone", NULL))
+		location = e_cal_util_get_system_timezone_location ();
+	else 
+		location = gconf_client_get_string (conf_client, "/apps/evolution/calendar/display/timezone", NULL);
+
 	if (location && location[0]) {
 		local_timezone = icaltimezone_get_builtin_timezone (location);
 	} else {
-- 
1.6.6


From bc16ee42d1b9606f123e23a95d67b9941376ad0a Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Fri, 8 Jan 2010 18:30:50 +0100
Subject: [PATCH 13/16] Bug #599794 - Set composer as not changed on reply or forward action

---
 mail/em-composer-utils.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 71c75c1..0a61e3f 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1065,7 +1065,7 @@ forward_attached (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, Cam
 	if (uids)
 		setup_forward_attached_callbacks (composer, folder, uids);
 
-	composer_set_no_change (composer, TRUE, FALSE);
+	composer_set_no_change (composer, TRUE, TRUE);
 
 	if (!e_msg_composer_get_lite())
 		gtk_widget_show (GTK_WIDGET (composer));
@@ -1148,7 +1148,7 @@ forward_non_attached (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages,
 				if (uids && uids->pdata[i])
 					em_composer_utils_setup_callbacks (composer, folder, uids->pdata[i], CAMEL_MESSAGE_FORWARDED, CAMEL_MESSAGE_FORWARDED, NULL, NULL);
 
-				composer_set_no_change (composer, TRUE, FALSE);
+				composer_set_no_change (composer, TRUE, TRUE);
 				if (!e_msg_composer_get_lite())
 					gtk_widget_show (GTK_WIDGET (composer));
 			}
@@ -1329,7 +1329,7 @@ em_utils_redirect_message (CamelMimeMessage *message)
 
 	gtk_widget_show (GTK_WIDGET (composer));
 
-	composer_set_no_change (composer, TRUE, FALSE);
+	composer_set_no_change (composer, TRUE, TRUE);
 }
 
 static void
@@ -2410,7 +2410,7 @@ em_utils_reply_to_message(CamelFolder *folder, const gchar *uid, CamelMimeMessag
 
 	em_composer_utils_setup_callbacks (composer, folder, uid, flags, flags, NULL, NULL);
 
-	composer_set_no_change (composer, TRUE, FALSE);
+	composer_set_no_change (composer, TRUE, TRUE);
 
 	if (!e_msg_composer_get_lite())
 		gtk_widget_show (GTK_WIDGET (composer));
-- 
1.6.6


From 68a3c7fdc5277b82e098a5ecfc06da3c8313b0e1 Mon Sep 17 00:00:00 2001
From: Lucian Langa <lucilanga@gnome.org>
Date: Sat, 9 Jan 2010 09:50:14 +0200
Subject: [PATCH 14/16] Bug 606449 -  empty mail-notification popups

---
 plugins/mail-notification/mail-notification.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c
index c42473a..a2340ce 100644
--- a/plugins/mail-notification/mail-notification.c
+++ b/plugins/mail-notification/mail-notification.c
@@ -484,7 +484,7 @@ can_support_actions (void)
 static void
 new_notify_status (EMEventTargetFolder *t)
 {
-	gchar *msg;
+	gchar *msg, *safetext;
 	gboolean new_icon = !status_icon;
 
 	if (new_icon) {
@@ -516,13 +516,14 @@ new_notify_status (EMEventTargetFolder *t)
 	#ifdef HAVE_LIBNOTIFY
 	/* Now check whether we're supposed to send notifications */
 	if (is_part_enabled (GCONF_KEY_STATUS_NOTIFICATION)) {
+		safetext = g_markup_escape_text(msg, strlen(msg));
 		if (notify) {
-			notify_notification_update (notify, _("New email"), msg, "mail-unread");
+			notify_notification_update (notify, _("New email"), safetext, "mail-unread");
 		} else {
 			if (!notify_init ("evolution-mail-notification"))
 				fprintf (stderr,"notify init error");
 
-			notify  = notify_notification_new (_("New email"), msg, "mail-unread", NULL);
+			notify  = notify_notification_new (_("New email"), safetext, "mail-unread", NULL);
 			notify_notification_attach_to_status_icon (notify, status_icon);
 
 			/* Check if actions are supported */
@@ -533,6 +534,7 @@ new_notify_status (EMEventTargetFolder *t)
 				g_timeout_add (500, notification_callback, notify);
 			}
 		}
+		g_free(safetext);
 	}
 	#endif
 
-- 
1.6.6


From 42b963370ae908d2bc0b3300f018f8b8d515deaa Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Mon, 11 Jan 2010 16:11:58 +0100
Subject: [PATCH 15/16] Bug #605485 - Keeps search from previous folder in message list

---
 mail/em-folder-browser.c    |    2 +-
 widgets/misc/e-search-bar.c |   22 +++++++++++++++-------
 widgets/misc/e-search-bar.h |    2 ++
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 54277cd..b93f4d8 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -2152,7 +2152,7 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const gchar *uri)
 				|| em_utils_folder_is_sent (emfv->folder, emfv->folder_uri)
 				|| em_utils_folder_is_outbox (emfv->folder, emfv->folder_uri);
 
-			e_search_bar_set_text ((ESearchBar *)emfb->search, "");
+			e_search_bar_clear_search ((ESearchBar *)emfb->search);
 
 			if (outgoing) {
 				e_search_bar_set_item_id ((ESearchBar *)emfb->search, 1);
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index a65517b..c9d75e5 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -246,13 +246,7 @@ clear_verb_cb (BonoboUIComponent *ui_component,
 	ESearchBar *esb;
 	esb = E_SEARCH_BAR (data);
 
-	gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
-	gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
-	gtk_widget_modify_base (esb->icon_entry, GTK_STATE_NORMAL, NULL);
-	gtk_widget_set_sensitive (esb->clear_button, FALSE);
-
-	clear_search (esb);
-	gtk_entry_set_text (GTK_ENTRY (esb->entry), "");
+	e_search_bar_clear_search (esb);
 	gtk_widget_grab_focus (esb->entry);
 }
 
@@ -1616,6 +1610,20 @@ e_search_bar_set_ids (ESearchBar *search_bar, gint item_id, gint subitem_id)
 
 }
 
+void
+e_search_bar_clear_search (ESearchBar *esb)
+{
+	g_return_if_fail (E_IS_SEARCH_BAR (esb));
+
+	gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
+	gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
+	gtk_widget_modify_base (esb->icon_entry, GTK_STATE_NORMAL, NULL);
+	gtk_widget_set_sensitive (esb->clear_button, FALSE);
+
+	clear_search (esb);
+	gtk_entry_set_text (GTK_ENTRY (esb->entry), "");
+}
+
 /**
  * e_search_bar_set_text:
  * @search_bar: A search bar.
diff --git a/widgets/misc/e-search-bar.h b/widgets/misc/e-search-bar.h
index 5385ebf..4aeab7f 100644
--- a/widgets/misc/e-search-bar.h
+++ b/widgets/misc/e-search-bar.h
@@ -185,6 +185,8 @@ GtkWidget *e_search_bar_get_selected_viewitem (ESearchBar *search_bar);
 
 gint e_search_bar_get_search_scope (ESearchBar *search_bar);
 
+void e_search_bar_clear_search (ESearchBar *esb);
+
 void  e_search_bar_set_text  (ESearchBar *search_bar,
 			      const gchar *text);
 gchar *e_search_bar_get_text  (ESearchBar *search_bar);
-- 
1.6.6


From e46b9afca6f77c63288b54e59714c0b2fe02a3a2 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Wed, 13 Jan 2010 19:19:42 +0100
Subject: [PATCH 16/16] Bug #604670 - addressbook-export segfaults when specifying addressbook

---
 addressbook/tools/evolution-addressbook-export.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c
index c8ae956..58831ed 100644
--- a/addressbook/tools/evolution-addressbook-export.c
+++ b/addressbook/tools/evolution-addressbook-export.c
@@ -75,6 +75,8 @@ main (gint argc, gchar **argv)
 	gint IsCSV = FALSE;
 	gint IsVCard = FALSE;
 
+	g_type_init ();
+
 	/*i18n-lize */
 	bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-- 
1.6.6