Re: Move and copy messages



I would rename "folder_src" to "self" (because that is how all the other
types are named). I know this doesn't matter for the compiler. But I'd
like to keep this convention (self, this, base are the typical words in
OO design to indicate the instance on which the operation happens).

I also understand that this is a exceptional one, because you actually
do a communication between two instances.

I view it like this: you give self the command to transfer its messages
to another folder. 

If another entity would have done this, it would have be a strategy. Say
that is desired, we can still refactor this work to a strategy.

For example like this:

interface TnyMsgTransferrer
{
	void perform_transfer (TnyFolder *from, TnyFolder *to, ...);
}

interface TnyCanTransferMsgs
{
	TnyMsgTransferrer * get_transferrer();
	void transfer (TnyFolder *from, TnyFolder *to, ...);
}

class TnyMyFolder : TnyFolder, TnyCanTransferMsgs
{
}

For now I don't see a need for that. And we don't have to use a pattern
unless there's a clear need for it (maybe we even shouldn't, but that is
of course subjective).


+/**
+ * tny_folder_transfer_msgs:
+ * @folder_src: the TnyFolder where the headers are stored
+ * @header_list: a list of TnyHeader objects
+ * @folder_dst: the TnyFolder where the msgs will be transfered
+ * @delete_originals: if TRUE then move msgs, else copy them
+ * 
+ * Transfers messages from a folder to another. They could be moved or
+ * just copied depending on the value of the delete_originals argument
+ **/
+void 
+tny_folder_transfer_msgs (TnyFolder *folder_src, 
+                         TnyList *headers, 
+                         TnyFolder *folder_dst, 
+                         gboolean delete_originals)



-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
blog: http://pvanhoof.be/blog




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