[anjuta] msg: Save first line of message pane and do not report a wrong error



commit e436e236e700a8ef51b48d5aca81c622db1fed86
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sat Mar 6 10:25:28 2010 +0100

    msg: Save first line of message pane and do not report a wrong error

 plugins/message-view/message-view.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/plugins/message-view/message-view.c b/plugins/message-view/message-view.c
index 7a1ba70..5047347 100644
--- a/plugins/message-view/message-view.c
+++ b/plugins/message-view/message-view.c
@@ -894,7 +894,7 @@ static gboolean message_view_save_as(MessageView* view, gchar* uri)
 
 	ok = TRUE;
 	gtk_tree_model_get_iter_first (model, &iter);
-	while (gtk_tree_model_iter_next (model, &iter))
+	do
 	{
 		Message *message;
 
@@ -903,24 +903,24 @@ static gboolean message_view_save_as(MessageView* view, gchar* uri)
 		{
 			if (message->details && (strlen (message->details) > 0))
 			{
-				if (!g_output_stream_write (os, message->details, strlen (message->details), NULL, NULL))
+				if (g_output_stream_write (os, message->details, strlen (message->details), NULL, NULL) < 0)
 				{
 					ok = FALSE;
 				}
 			}
 			else
 			{
-				if (!g_output_stream_write (os, message->summary, strlen (message->summary), NULL, NULL))
+				if (g_output_stream_write (os, message->summary, strlen (message->summary), NULL, NULL) < 0)
 				{
 					ok = FALSE;
 				}
 			}
-			if (!g_output_stream_write (os, "\n", 1, NULL, NULL))
+			if (g_output_stream_write (os, "\n", 1, NULL, NULL) < 0)
 			{
 				ok = FALSE;
 			}
 		}
-	}
+	} while (gtk_tree_model_iter_next (model, &iter));
 	g_output_stream_close (os, NULL, NULL);
 	g_object_unref (os);
 	g_object_unref (file);



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