Re: [evolution-patches] [calendar] fix for bug #306673



have attached the modified patch.
please review


On Mon, 2005-10-03 at 10:46 +0000, "Dinesh Layek"  wrote:
> Attached patch fixes bug#306673 ("Save calendar" freezes evo after
> missing file extension warning).
> 
> Please Review
> 
> Regards,
> Dinesh
> 
Index: save-calendar.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/save-calendar/save-calendar.c,v
retrieving revision 1.8
diff -u -p -r1.8 save-calendar.c
--- save-calendar.c	25 Feb 2005 09:55:29 -0000	1.8
+++ save-calendar.c	27 Oct 2005 11:13:05 -0000
@@ -116,7 +116,6 @@ ask_destination_and_save (EPlugin *ep, E
 	GtkTreeIter iter;
 	GtkWidget *dialog = NULL;
 	char *dest_uri = NULL;
-	gboolean proceed = FALSE;
 
 	GList *format_handlers = NULL;
 
@@ -202,48 +201,25 @@ ask_destination_and_save (EPlugin *ep, E
 
 		tmp = strstr (dest_uri, handler->filename_ext);
 
-		if (tmp && *(tmp + strlen (handler->filename_ext)) == '\0') {
+		if (!(tmp && *(tmp + strlen (handler->filename_ext)) == '\0')) {
 
-			proceed = TRUE;
-
-		} else {
-
-			GtkWidget *warning = 
-				gtk_message_dialog_new (NULL,
-				GTK_DIALOG_DESTROY_WITH_PARENT,
-				GTK_MESSAGE_QUESTION,
-				GTK_BUTTONS_YES_NO,
-				_("The suggested filename extension of this filetype (%s)"
-				  " is unused in the chosen filename. Do you want to "
-				  "continue?"), handler->filename_ext);
-
-			if (gtk_dialog_run (GTK_DIALOG (warning)) == GTK_RESPONSE_YES)
-				proceed = TRUE;
-
-			gtk_widget_destroy (warning);
-
-		}
-
-		if (proceed) {
-			handler->save (handler, ep, target, type, dest_uri);
-			/* Free the handlers */
-			g_list_foreach (format_handlers, format_handlers_foreach_free, NULL);
-			g_list_free (format_handlers);
-
-			/* Now we can destroy it */
-			gtk_widget_destroy (dialog);	
+			char *temp;
+			temp = g_strconcat (dest_uri, handler->filename_ext);
 			g_free (dest_uri);
+			dest_uri = temp;
 		}
 
-	} else {
-		/* Free the handlers */
-		g_list_foreach (format_handlers, format_handlers_foreach_free, NULL);
-		g_list_free (format_handlers);
-
-		/* Now we can destroy it */
-		gtk_widget_destroy (dialog);	
-		g_free (dest_uri);
+		handler->save (handler, ep, target, type, dest_uri);
 	}
+
+	/* Free the handlers */
+	g_list_foreach (format_handlers, format_handlers_foreach_free, NULL);
+	g_list_free (format_handlers);
+
+	/* Now we can destroy it */
+	gtk_widget_destroy (dialog);	
+	g_free (dest_uri);
+
 }
 
 void
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/save-calendar/ChangeLog,v
retrieving revision 1.23
diff -u -p -r1.23 ChangeLog
--- ChangeLog	24 Aug 2005 03:13:50 -0000	1.23
+++ ChangeLog	27 Oct 2005 11:13:05 -0000
@@ -1,3 +1,8 @@
+2005-10-27  Dinesh Layek  <LDinesh novell com>
+
+	* save-calendar.c (ask_destination_and_save): append the file_extension 
+	if the user does not provide it.
+
 2005-08-23  Not Zed  <NotZed Ximian com>
 
 	* ical-format.c: include missing header.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]