CVS: sylpheedclaws/plugins/vcalendar/src vcal_folder.c,1.2.2.52,1.2.2.53 vcal_manager.c,1.1.2.49,1.1.2.50

[email protected] Wed, 27 Dec 2006 23:13:19 +0000
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /pack/anoncvs/sylpheedclaws/plugins/vcalendar/src
In directory sunsite.dk:/tmp/cvs-serv6446/src

Modified Files:
      Tag: gtk2
	vcal_folder.c vcal_manager.c 
Log Message:
2006-12-27 [colin]	1.91.0cvs9

	* src/vcal_folder.c
	* src/vcal_manager.c
		Fix summaries with \n's in subject

Index: vcal_folder.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/plugins/vcalendar/src/vcal_folder.c,v
retrieving revision 1.2.2.52
retrieving revision 1.2.2.53
diff -u -d -r1.2.2.52 -r1.2.2.53
--- vcal_folder.c	2006/12/27 22:06:19	1.2.2.52
+++ vcal_folder.c	2006/12/27 23:13:14	1.2.2.53
@@ -569,29 +569,29 @@
 		*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
 		debug_print("add %d\n", n_msg); \
 		n_msg++; \
-	} \
-	days = event_to_today(event, 0); \
- \
-	if (days == EVENT_PAST && past_msg == -1) { \
-		*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
-		past_msg = n_msg++; \
-		g_hash_table_insert(hash_uids, g_strdup_printf("%d", past_msg), g_strdup(EVENT_PAST_ID)); \
-	} else if (days == EVENT_TODAY && today_msg == -1) { \
-		*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
-		today_msg = n_msg++; \
-		g_hash_table_insert(hash_uids, g_strdup_printf("%d", today_msg), g_strdup(EVENT_TODAY_ID)); \
-	} else if (days == EVENT_TOMORROW && tomorrow_msg == -1) { \
-		*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
-		tomorrow_msg = n_msg++; \
-		g_hash_table_insert(hash_uids, g_strdup_printf("%d", tomorrow_msg), g_strdup(EVENT_TOMORROW_ID)); \
-	} else if (days == EVENT_THISWEEK && thisweek_msg == -1) { \
-		*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
-		thisweek_msg = n_msg++; \
-		g_hash_table_insert(hash_uids, g_strdup_printf("%d", thisweek_msg), g_strdup(EVENT_THISWEEK_ID)); \
-	} else if (days == EVENT_LATER && later_msg == -1) { \
-		*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
-		later_msg = n_msg++; \
-		g_hash_table_insert(hash_uids, g_strdup_printf("%d", later_msg), g_strdup(EVENT_LATER_ID)); \
+		days = event_to_today(event, 0); \
+	 \
+		if (days == EVENT_PAST && past_msg == -1) { \
+			*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
+			past_msg = n_msg++; \
+			g_hash_table_insert(hash_uids, g_strdup_printf("%d", past_msg), g_strdup(EVENT_PAST_ID)); \
+		} else if (days == EVENT_TODAY && today_msg == -1) { \
+			*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
+			today_msg = n_msg++; \
+			g_hash_table_insert(hash_uids, g_strdup_printf("%d", today_msg), g_strdup(EVENT_TODAY_ID)); \
+		} else if (days == EVENT_TOMORROW && tomorrow_msg == -1) { \
+			*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
+			tomorrow_msg = n_msg++; \
+			g_hash_table_insert(hash_uids, g_strdup_printf("%d", tomorrow_msg), g_strdup(EVENT_TOMORROW_ID)); \
+		} else if (days == EVENT_THISWEEK && thisweek_msg == -1) { \
+			*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
+			thisweek_msg = n_msg++; \
+			g_hash_table_insert(hash_uids, g_strdup_printf("%d", thisweek_msg), g_strdup(EVENT_THISWEEK_ID)); \
+		} else if (days == EVENT_LATER && later_msg == -1) { \
+			*list = g_slist_append(*list, GINT_TO_POINTER(n_msg)); \
+			later_msg = n_msg++; \
+			g_hash_table_insert(hash_uids, g_strdup_printf("%d", later_msg), g_strdup(EVENT_LATER_ID)); \
+		} \
 	} \
 }
 

Index: vcal_manager.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/plugins/vcalendar/src/vcal_manager.c,v
retrieving revision 1.1.2.49
retrieving revision 1.1.2.50
diff -u -d -r1.1.2.49 -r1.1.2.50
--- vcal_manager.c	2006/12/27 22:06:19	1.1.2.49
+++ vcal_manager.c	2006/12/27 23:13:14	1.1.2.50
@@ -797,6 +797,9 @@
 	event->sequence		= sequence;
 	event->type		= type;
 	event->rec_occurence		= FALSE;
+	while (strchr(event->summary, '\n'))
+		*(strchr(event->summary, '\n')) = ' ';
+
 	return event;
 }
 					 
@@ -1085,6 +1088,9 @@
 	/* vcal_manager_event_print(event); */
 	xml_free_tree(node);
 
+	while (strchr(event->summary, '\n'))
+		*(strchr(event->summary, '\n')) = ' ';
+
 	return event;
 	
 }
@@ -1275,6 +1281,9 @@
 	} else {
 		summary = g_strdup("");
 	}
+	
+	while (strchr(summary, '\n'))
+		*(strchr(summary, '\n')) = ' ';
 
 	prop = icalcomponent_get_first_property(ievent, ICAL_ORGANIZER_PROPERTY);
 	if (prop) {