gmime r1262 - in branches/gmime-2-2: examples tests



Author: fejj
Date: Sat May 24 12:37:59 2008
New Revision: 1262
URL: http://svn.gnome.org/viewvc/gmime?rev=1262&view=rev

Log:
don't use deprecated functions

Modified:
   branches/gmime-2-2/examples/imap-example.c
   branches/gmime-2-2/tests/test-best.c
   branches/gmime-2-2/tests/test-html.c
   branches/gmime-2-2/tests/test-parser.c
   branches/gmime-2-2/tests/test-partial.c
   branches/gmime-2-2/tests/test-pgpmime.c
   branches/gmime-2-2/tests/test-streams.c

Modified: branches/gmime-2-2/examples/imap-example.c
==============================================================================
--- branches/gmime-2-2/examples/imap-example.c	(original)
+++ branches/gmime-2-2/examples/imap-example.c	Sat May 24 12:37:59 2008
@@ -310,7 +310,7 @@
 		
 		ostream = g_mime_stream_file_new (fp);
 		g_mime_object_write_to_stream (GMIME_OBJECT (message), ostream);
-		g_mime_stream_unref (ostream);
+		g_object_unref (ostream);
 	} else if (GMIME_IS_PART (part)) {
 		buf = g_strdup_printf ("%s/%s.TEXT", uid, spec);
 		fp = fopen (buf, "wt");
@@ -320,8 +320,8 @@
 		istream = g_mime_data_wrapper_get_stream (GMIME_PART (part)->content);
 		
 		g_mime_stream_write_to_stream (istream, ostream);
-		g_mime_stream_unref (istream);
-		g_mime_stream_unref (ostream);
+		g_object_unref (istream);
+		g_object_unref (ostream);
 	}
 }
 

Modified: branches/gmime-2-2/tests/test-best.c
==============================================================================
--- branches/gmime-2-2/tests/test-best.c	(original)
+++ branches/gmime-2-2/tests/test-best.c	Sat May 24 12:37:59 2008
@@ -42,7 +42,7 @@
 	
 	stream = g_mime_stream_fs_new (fd);
 	istream = g_mime_stream_filter_new_with_stream (stream);
-	g_mime_stream_unref (stream);
+	g_object_unref (stream);
 	best = (GMimeFilterBest *) g_mime_filter_best_new (GMIME_FILTER_BEST_CHARSET |
 							   GMIME_FILTER_BEST_ENCODING);
 	
@@ -65,8 +65,8 @@
 		g_mime_part_encoding_to_string (
 			g_mime_filter_best_encoding (best, GMIME_BEST_ENCODING_BINARY)));
 	
-	g_mime_stream_unref (istream);
-	g_mime_stream_unref (null);
+	g_object_unref (istream);
+	g_object_unref (null);
 	
 	return 0;
 }

Modified: branches/gmime-2-2/tests/test-html.c
==============================================================================
--- branches/gmime-2-2/tests/test-html.c	(original)
+++ branches/gmime-2-2/tests/test-html.c	Sat May 24 12:37:59 2008
@@ -33,7 +33,7 @@
 	
 	fstream = g_mime_stream_file_new (stdout);
 	ostream = g_mime_stream_filter_new_with_stream (fstream);
-	g_mime_stream_unref (fstream);
+	g_object_unref (fstream);
 	html = g_mime_filter_html_new (GMIME_FILTER_HTML_CONVERT_NL |
 				       GMIME_FILTER_HTML_CONVERT_SPACES |
 				       GMIME_FILTER_HTML_CONVERT_URLS |
@@ -55,10 +55,10 @@
 		
 		istream = g_mime_stream_file_new (fp);
 		g_mime_stream_write_to_stream (istream, ostream);
-		g_mime_stream_unref (istream);
+		g_object_unref (istream);
 	}
 	
-	g_mime_stream_unref (ostream);
+	g_object_unref (ostream);
 	
 	return 0;
 }

Modified: branches/gmime-2-2/tests/test-parser.c
==============================================================================
--- branches/gmime-2-2/tests/test-parser.c	(original)
+++ branches/gmime-2-2/tests/test-parser.c	Sat May 24 12:37:59 2008
@@ -107,7 +107,7 @@
 	g_object_unref (parser);
 	
 	ZenTimerStart (NULL);
-	text = g_mime_message_to_string (message);
+	text = g_mime_object_to_string ((GMimeObject *) message);
 	ZenTimerStop (NULL);
 	ZenTimerReport (NULL, "gmime::message_to_string");
 	/*fprintf (stdout, "Result should match previous MIME message dump\n\n%s\n", text);*/
@@ -135,7 +135,7 @@
 		g_mime_header_write_to_stream (GMIME_OBJECT (message)->headers, stream);
 		g_mime_stream_flush (stream);
 		GMIME_STREAM_FILE (stream)->fp = NULL;
-		g_mime_stream_unref (stream);
+		g_object_unref (stream);
 		fprintf (stdout, "\n");
 	}
 #endif
@@ -159,7 +159,7 @@
 	g_mime_object_write_to_stream (GMIME_OBJECT (message), stream);
 	g_mime_stream_flush (stream);
 	GMIME_STREAM_FS (stream)->fd = -1;
-	g_mime_stream_unref (stream);
+	g_object_unref (stream);
 #endif
 	
 #ifdef PRINT_MIME_STRUCT
@@ -167,7 +167,7 @@
 	print_mime_struct (message->mime_part, 0);
 #endif
 	
-	g_mime_object_unref (GMIME_OBJECT (message));
+	g_object_unref (message);
 }
 
 
@@ -204,20 +204,20 @@
 	istream = g_mime_stream_mem_new ();
 	g_mime_stream_write_to_stream (stream, istream);
 	g_mime_stream_reset (istream);
-	g_mime_stream_unref (stream);
+	g_object_unref (stream);
 	stream = istream;
 #endif
 	
 #ifdef STREAM_BUFFER
 	istream = g_mime_stream_buffer_new (stream,
 					    GMIME_STREAM_BUFFER_BLOCK_READ);
-	g_mime_stream_unref (stream);
+	g_object_unref (stream);
 	stream = istream;
 #endif
 	
 	test_parser (stream);
 	
-	g_mime_stream_unref (stream);
+	g_object_unref (stream);
 	
 	g_mime_shutdown ();
 	

Modified: branches/gmime-2-2/tests/test-partial.c
==============================================================================
--- branches/gmime-2-2/tests/test-partial.c	(original)
+++ branches/gmime-2-2/tests/test-partial.c	Sat May 24 12:37:59 2008
@@ -80,7 +80,7 @@
 		
 		stream = g_mime_stream_fs_new (fd);
 		g_mime_parser_init_with_stream (parser, stream);
-		g_mime_stream_unref (stream);
+		g_object_unref (stream);
 		
 		if (!(message = g_mime_parser_construct_message (parser)))
 			return -2;
@@ -89,8 +89,8 @@
 			return -3;
 		
 		g_ptr_array_add (partials, message->mime_part);
-		g_mime_object_ref (GMIME_OBJECT (message->mime_part));
-		g_mime_object_unref (GMIME_OBJECT (message));
+		g_object_ref (message->mime_part);
+		g_object_unref (message);
 	}
 	
 	g_object_unref (parser);
@@ -106,8 +106,8 @@
 	
 	print_mime_struct (message->mime_part, 0);
 	
-	g_mime_object_unref (GMIME_OBJECT (message));
-	g_mime_stream_unref (stream);
+	g_object_unref (message);
+	g_object_unref (stream);
 	
 	g_mime_shutdown ();
 	

Modified: branches/gmime-2-2/tests/test-pgpmime.c
==============================================================================
--- branches/gmime-2-2/tests/test-pgpmime.c	(original)
+++ branches/gmime-2-2/tests/test-pgpmime.c	Sat May 24 12:37:59 2008
@@ -239,7 +239,7 @@
 	
 	g_mime_stream_reset (stream);
 	content = g_mime_data_wrapper_new_with_stream (stream, GMIME_PART_ENCODING_DEFAULT);
-	g_mime_stream_unref (stream);
+	g_object_unref (stream);
 	
 	g_mime_part_set_content_object (part, content);
 	g_object_unref (content);
@@ -278,7 +278,7 @@
 	
 	parser = g_mime_parser_new ();
 	g_mime_parser_init_with_stream (parser, stream);
-	g_mime_stream_unref (stream);
+	g_object_unref (stream);
 	
 	message = g_mime_parser_construct_message (parser);
 	g_object_unref (parser);

Modified: branches/gmime-2-2/tests/test-streams.c
==============================================================================
--- branches/gmime-2-2/tests/test-streams.c	(original)
+++ branches/gmime-2-2/tests/test-streams.c	Sat May 24 12:37:59 2008
@@ -175,7 +175,7 @@
 		testsuite_check_failed ("GMimeStreamBuffer::block gets() failed: %s",
 					ex->message);
 	} finally {
-		g_mime_stream_unref (buffered);
+		g_object_unref (buffered);
 	}
 	
 	testsuite_check ("GMimeStreamBuffer::cache gets");
@@ -188,10 +188,10 @@
 		testsuite_check_failed ("GMimeStreamBuffer::block gets() failed: %s",
 					ex->message);
 	} finally {
-		g_mime_stream_unref (buffered);
+		g_object_unref (buffered);
 	}
 	
-	g_mime_stream_unref (stream);
+	g_object_unref (stream);
 }
 
 
@@ -229,8 +229,8 @@
 					ex->message);
 	} finally;
 	
-	g_mime_stream_unref (fstream);
-	g_mime_stream_unref (stream);
+	g_object_unref (fstream);
+	g_object_unref (stream);
 	
 	testsuite_end ();
 }



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