Major changes happening at the get_headers method of TnyMsgFolderIface

Just letting you guys know.

I'm planning to move relaxed-destroying of the message headers to the
TnyMsgHeaderListModel implementation, rather than in the TnyMsgFolder
implementation (for camel). And no longer cache the headers in the
TnyMsgFolder instance.

This will remove the need for the "uncache" method of TnyMsgFolderIface
and and it will make it more easy to control the destruction of
instances in combination with viewing them in the GtkTreeView.

The API would change from the current one to something like this:

void tny_msg_folder_iface_get_headers (TnyMsgFolderIface *self,
	 TnyListIface **headers, gboolean refresh);

And in a Gtk+ context it would be used like this:

TnyListIface *model = tny_msg_header_list_model_new ();
tny_msg_folder_iface_get_headers (folder, &model, TRUE);
gtk_tree_view_set_model (treeview, GTK_TREE_MODEL (model));

Setting a new model would obviously unreference the model instance,
would therefore destroy it (if refcount becomes zero), and that
finalization would destroy the message header instances themselves.

Whereas now you need to manually launch the "uncache" method on the
TnyMsgFolder instance. This is not 'nice', of course.

The destruction of TnyMsgHeaderListModel will most likely reuse the
"relaxed performer" implementation which is currently being used in the
TnyMsgFolder camel implementation .. where it will be removed. 

Also this is a better location because the TnyMsgHeaderListModel
requires Gtk+. The "relaxed performer" requires a GMainLoop. A Gtk+
application *has* almost per definition a GMainLoop. So these changes
would solve a bunch of current coupling problems.

I will most likely finish the work on this tomorrow evening. Stay tuned.

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

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