Major API change in tinymail



I like to panic Dirk-Jan by putting in the subject that I did a major
API change.

This time I attached a patch for his beloved Modest, so that it will
cope with the API changes without any headaches in Finland.

I can commit this, waiting for confirmation. There's no Modest mailing
list yet, so I'm using the tinymail one for this. I hope that's okay?



public interface IPerson { }
public interface IFinn { }
public interface IPanicCause { void CausePanic (IPanicable p); }
public interface IPanicable { void GainPanic (PanicReason reason); }
public class Developer : IPerson { }
public class FinishDeveloper : Developer, IFinn { }
public class DirkJanClone : FinishDeveloper, IPanicable { ... }
public class MeClone : Developer, IPanicCause {
  public void CausePanic (IPanicable p) { p.GainPanic (PanicReason.APIChange); } }
int main () 
 { MeClone me = new MeClone (); DirkJanClone djcb = new DirkJanClone (); me.CausePanic (djcb); }


-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog
Index: src/modest-tny-platform-factory.c
===================================================================
--- src/modest-tny-platform-factory.c	(revision 885)
+++ src/modest-tny-platform-factory.c	(working copy)
@@ -53,7 +53,6 @@
 static TnyMsgView*      modest_tny_platform_factory_new_msg_view      (TnyPlatformFactory *self);
 static TnyMsg*          modest_tny_platform_factory_new_msg           (TnyPlatformFactory *self);
 static TnyMimePart*     modest_tny_platform_factory_new_mime_part     (TnyPlatformFactory *self);
-static TnyHeader*       modest_tny_platform_factory_new_header        (TnyPlatformFactory *self);
 
 
 /* list my signals  */
@@ -162,7 +161,6 @@
 	klass->new_msg_view_func      = modest_tny_platform_factory_new_msg_view;
 	klass->new_msg_func           = modest_tny_platform_factory_new_msg;
 	klass->new_mime_part_func     = modest_tny_platform_factory_new_mime_part;
-	klass->new_header_func        = modest_tny_platform_factory_new_header;
 
 	return;
 }
@@ -210,8 +208,3 @@
 }
 
 
-static TnyHeader*
-modest_tny_platform_factory_new_header (TnyPlatformFactory *self)
-{
-	return tny_camel_header_new ();
-}
Index: src/modest-mail-operation.c
===================================================================
--- src/modest-mail-operation.c	(revision 885)
+++ src/modest-mail-operation.c	(working copy)
@@ -312,9 +312,8 @@
 	g_object_unref (G_OBJECT(body));
 	
 	/* Fill the header */
-	new_header = TNY_HEADER (tny_platform_factory_new_header
-				 (modest_runtime_get_platform_factory()));
-	tny_msg_set_header (new_msg, new_header);
+	new_header = tny_msg_get_header (new_msg);
+
 	tny_header_set_from (new_header, from);
 	tny_header_set_replyto (new_header, from);
 
Index: src/modest-tny-msg.c
===================================================================
--- src/modest-tny-msg.c	(revision 885)
+++ src/modest-tny-msg.c	(working copy)
@@ -62,10 +62,9 @@
 	/* Create new msg */
 	fact    = modest_runtime_get_platform_factory ();
 	new_msg = tny_platform_factory_new_msg (fact);
-	header  = tny_platform_factory_new_header (fact);
+
+	header  = tny_msg_get_header (new_msg);
 	
-	/* WARNING: set the header before assign values to it */
-	tny_msg_set_header (new_msg, header);
 	tny_header_set_from (TNY_HEADER (header), from);
 	tny_header_set_replyto (TNY_HEADER (header), from);
 	tny_header_set_to (TNY_HEADER (header), mailto);


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