[Commits] vcal_folder.c 1.2.2.120 1.2.2.121 vcal_folder.h 1.1.2.15 1.1.2.16 vcal_meeting_gtk.c 1.1.2.95 1.1.2.96

colin at claws-mail.org colin at claws-mail.org
Fri Nov 16 10:03:35 CET 2012


Update of /home/claws-mail/plugins/vcalendar/src
In directory srv:/tmp/cvs-serv7567/src

Modified Files:
      Tag: gtk2
	vcal_folder.c vcal_folder.h vcal_meeting_gtk.c 
Log Message:
2012-11-16 [colin]	2.0.14cvs3

	* src/vcal_folder.c
	* src/vcal_folder.h
	* src/vcal_meeting_gtk.c
		Fix bug #2782, '[security] vCalendar: status tray should display
		"Fetching: <folder>" vs "Fetching: <url>"'

Index: vcal_folder.h
===================================================================
RCS file: /home/claws-mail/plugins/vcalendar/src/vcal_folder.h,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -u -d -r1.1.2.15 -r1.1.2.16
--- vcal_folder.h	6 Nov 2011 12:06:21 -0000	1.1.2.15
+++ vcal_folder.h	16 Nov 2012 09:03:33 -0000	1.1.2.16
@@ -36,7 +36,7 @@
 void vcal_folder_export(Folder *folder);
 
 gboolean vcal_curl_put(gchar *url, FILE *fp, gint filesize, const gchar *user, const gchar *pass);
-gchar *vcal_curl_read(const char *url, gboolean verbose, 
+gchar *vcal_curl_read(const char *url, const gchar *label, gboolean verbose, 
 	void (*callback)(const gchar *url, gchar *data, gboolean verbose, gchar
 		*error));
 gchar* get_item_event_list_for_date(FolderItem *item, EventTime date);

Index: vcal_meeting_gtk.c
===================================================================
RCS file: /home/claws-mail/plugins/vcalendar/src/vcal_meeting_gtk.c,v
retrieving revision 1.1.2.95
retrieving revision 1.1.2.96
diff -u -d -r1.1.2.95 -r1.1.2.96
--- vcal_meeting_gtk.c	30 Oct 2011 10:12:54 -0000	1.1.2.95
+++ vcal_meeting_gtk.c	16 Nov 2012 09:03:33 -0000	1.1.2.96
@@ -1085,7 +1085,7 @@
 
 		if (!local_only) {
 			remail = g_strdup(email);
-			g_free(email);
+
 			extract_address(remail);
 			if (strrchr(remail, ' '))
 				user = g_strdup(strrchr(remail, ' ')+1);
@@ -1125,17 +1125,22 @@
 			&& strncmp(tmp, "ftp://", 6))
 				contents = file_read_to_str(tmp);
 			else {
+				gchar *label = g_strdup_printf(_("Fetching planning for %s..."), email);
 				if (!strncmp(tmp, "webcal://", 9)) {
 					gchar *tmp2 = g_strdup_printf("http://%s", tmp+9);
 					g_free(tmp);
 					tmp = tmp2;
 				}
-				contents = vcal_curl_read(tmp, FALSE, NULL);
+				contents = vcal_curl_read(tmp, label, FALSE, NULL);
+				g_free(label);
 			}
 		} else {
 			contents = NULL;
 		}
+
+		g_free(email);
 		g_free(tmp);
+
 		if (contents == NULL) {
 			uncertain = TRUE;
 			att_update_icon(meet, attendee, 2, _("Free/busy retrieval failed"));

Index: vcal_folder.c
===================================================================
RCS file: /home/claws-mail/plugins/vcalendar/src/vcal_folder.c,v
retrieving revision 1.2.2.120
retrieving revision 1.2.2.121
diff -u -d -r1.2.2.120 -r1.2.2.121
--- vcal_folder.c	11 Jul 2012 22:01:23 -0000	1.2.2.120
+++ vcal_folder.c	16 Nov 2012 09:03:33 -0000	1.2.2.121
@@ -1609,7 +1609,7 @@
 	return GINT_TO_POINTER(0);
 }
 
-gchar *vcal_curl_read(const char *url, gboolean verbose, 
+gchar *vcal_curl_read(const char *url, const gchar *label, gboolean verbose, 
 	void (*callback)(const gchar *url, gchar *data, gboolean verbose, gchar *error))
 {
 	gchar *result;
@@ -1618,25 +1618,19 @@
 	pthread_t pt;
 	pthread_attr_t pta;
 #endif
-	gchar *msg;
 	void *res;
 	gboolean killed;
 	gchar *error = NULL;
 	result = NULL;
 	td = g_new0(thread_data, 1);
-	msg = NULL;
 	res = NULL;
 	killed = FALSE;
-	
+
 	td->url  = url;
 	td->result  = NULL;
 	td->done = FALSE;
-	
-	msg = g_strdup_printf(_("Fetching '%s'..."), url);
-	
-	STATUSBAR_PUSH(mainwindow_get_mainwindow(), msg);
-	
-	g_free(msg);
+
+	STATUSBAR_PUSH(mainwindow_get_mainwindow(), label);
 
 #ifdef USE_PTHREAD
 	if (pthread_attr_init(&pta) != 0 ||
@@ -1868,7 +1862,8 @@
 static void update_subscription(const gchar *uri, gboolean verbose)
 {
 	FolderItem *item = get_folder_item_for_uri(uri);
-	
+	gchar *label;
+
 	if (prefs_common_get_prefs()->work_offline) {
 		if (!verbose || 
 		!inc_offline_should_override(TRUE,
@@ -1882,7 +1877,11 @@
 			return;
 	}
 	main_window_cursor_wait(mainwindow_get_mainwindow());
-	vcal_curl_read(uri, verbose, update_subscription_finish);
+
+	label = g_strdup_printf(_("Fetching calendar for %s..."), 
+			item && item->name ? item->name : _("new subscription"));
+	vcal_curl_read(uri, label, verbose, update_subscription_finish);
+	g_free(label);
 }
 
 static void check_subs_cb(GtkAction *action, gpointer data)



More information about the Commits mailing list