gmime r1336 - trunk/mono
- From: fejj svn gnome org
- To: svn-commits-list gnome org
- Subject: gmime r1336 - trunk/mono
- Date: Thu, 5 Jun 2008 16:53:57 +0000 (UTC)
Author: fejj
Date: Thu Jun 5 16:53:57 2008
New Revision: 1336
URL: http://svn.gnome.org/viewvc/gmime?rev=1336&view=rev
Log:
more fixes
Modified:
trunk/mono/GMime.metadata
trunk/mono/InternetAddressList.cs
trunk/mono/Message.custom
Modified: trunk/mono/GMime.metadata
==============================================================================
--- trunk/mono/GMime.metadata (original)
+++ trunk/mono/GMime.metadata Thu Jun 5 16:53:57 2008
@@ -188,6 +188,7 @@
<!-- References -->
<attr path="/api/namespace/struct[ name='References']" name="opaque">true</attr>
<attr path="/api/namespace/struct[ name='References']/method[ name='Decode']" name="name">Parse</attr>
+ <remove-node path="/api/namespace/struct[ name='References']/method[ name='Clear']"/>
<!-- Session -->
Modified: trunk/mono/InternetAddressList.cs
==============================================================================
--- trunk/mono/InternetAddressList.cs (original)
+++ trunk/mono/InternetAddressList.cs Thu Jun 5 16:53:57 2008
@@ -4,8 +4,8 @@
namespace GMime {
public class InternetAddressList : ArrayList, IDisposable {
- private IntPtr raw_list;
- private bool needs_destroy;
+ bool needs_destroy;
+ IntPtr raw_list;
[DllImport("gmime")]
static extern IntPtr internet_address_list_next (IntPtr raw);
@@ -18,8 +18,8 @@
public InternetAddressList (IntPtr raw_list, bool needs_destroy)
{
- this.raw_list = raw_list;
this.needs_destroy = needs_destroy;
+ this.raw_list = raw_list;
while (raw_list != IntPtr.Zero) {
IntPtr raw_ia = internet_address_list_get_address (raw_list);
@@ -37,7 +37,7 @@
{
this.Dispose ();
}
-
+
public void Dispose ()
{
if (this.needs_destroy) {
Modified: trunk/mono/Message.custom
==============================================================================
--- trunk/mono/Message.custom (original)
+++ trunk/mono/Message.custom Thu Jun 5 16:53:57 2008
@@ -17,82 +17,59 @@
public System.Collections.IEnumerable References {
get {
- string header = GetHeader ("References");
-
- if (header == null)
+ string references = GetHeader ("References");
+
+ if (references == null)
yield break;
-
- GMime.References gmime_reference = GMime.References.Parse (header);
-
- // keep gmime_reference for cleanup later
- GMime.References iterator = gmime_reference;
-
- while (iterator != null) {
- yield return iterator;
- iterator = iterator.Next;
+
+ GMime.References refs = GMime.References.Parse (references);
+ GMime.References iter = refs;
+
+ while (iter != null) {
+ yield return iter;
+ iter = iter.Next;
}
-
- gmime_reference.Clear ();
+
yield break;
}
}
[DllImport("gmime")]
-static extern IntPtr internet_address_list_get_address (IntPtr raw);
-
-[DllImport("gmime")]
-static extern IntPtr internet_address_to_string (IntPtr raw, bool encode);
-
-[DllImport("gmime")]
-static extern IntPtr internet_address_list_next (IntPtr raw);
+static extern IntPtr internet_address_list_to_string (IntPtr list, bool encode);
public string GetRecipientsAsString (RecipientType type, bool encode)
{
- IntPtr raw_list = g_mime_message_get_recipients (Handle, type.ToString ());
-
- if (raw_list == IntPtr.Zero)
+ IntPtr list = g_mime_message_get_recipients (Handle, type.ToString ());
+ IntPtr str;
+
+ if (list == IntPtr.Zero)
return null;
-
- System.Text.StringBuilder sb = new System.Text.StringBuilder ();
- bool first = true;
-
- while (raw_list != IntPtr.Zero) {
- IntPtr raw_ia = internet_address_list_get_address (raw_list);
- IntPtr raw_str = internet_address_to_string (raw_ia, encode);
-
- if (!first)
- sb.Append (", ");
- else
- first = false;
-
- sb.Append (GLib.Marshaller.PtrToStringGFree (raw_str));
-
- raw_list = internet_address_list_next (raw_list);
- }
-
- return sb.ToString ();
+
+ str = internet_address_list_to_string (list, encode);
+
+ return GLib.Marshaller.PtrToStringGFree (str);
}
public string GetRecipientsAsString (RecipientType type)
{
- return this.GetRecipientsAsString (type, false);
+ return GetRecipientsAsString (type, false);
}
[DllImport("gmime")]
-static extern void g_mime_message_get_date (IntPtr raw, out IntPtr date, out int gmt_offset);
+static extern void g_mime_message_get_date (IntPtr message, out IntPtr date, out int gmt_offset);
[DllImport("gmime")]
-static extern void g_mime_message_set_date (IntPtr raw, IntPtr date, int gmt_offset);
+static extern void g_mime_message_set_date (IntPtr message, IntPtr date, int gmt_offset);
public DateTime Date {
get {
- IntPtr date_raw;
- int gmt_offset;
+ int tz_offset;
+ IntPtr date;
- g_mime_message_get_date (Handle, out date_raw, out gmt_offset);
+ g_mime_message_get_date (Handle, out date, out tz_offset);
- return GLib.Marshaller.time_tToDateTime (date_raw);
+ return GLib.Marshaller.time_tToDateTime (date);
}
set {
g_mime_message_set_date (Handle, GLib.Marshaller.DateTimeTotime_t (value), 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]