Hi! Here the patch that add tny_merge_folder_set_folder_type as discussed on IRC... Regards, Johannes
Index: ChangeLog =================================================================== --- ChangeLog (revision 2378) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2007-07-04 Johannes Schmid <johannes schmid openismus com> + + * libtinymail/tny-merge-folder.[ch]: + Added tny_merge_folder_set_folder_type() API to be able + to assing a different folder type to a tny-merger-folder + 2007-07-04 Philip Van Hoof <pvanhoof gnome org> * Implementation of tny_folder_poke_status for the total count of a Index: libtinymail/tny-merge-folder.c =================================================================== --- libtinymail/tny-merge-folder.c (revision 2378) +++ libtinymail/tny-merge-folder.c (working copy) @@ -35,6 +35,7 @@ gchar *id, *name; TnyList *mothers, *observers; GStaticRecMutex *lock; + TnyFolderType folder_type; }; #define TNY_MERGE_FOLDER_GET_PRIVATE(o) \ @@ -398,10 +399,20 @@ } +void +tny_merge_folder_set_folder_type (TnyMergeFolder* self, TnyFolderType folder_type) +{ + TnyMergeFolderPriv *priv = TNY_MERGE_FOLDER_GET_PRIVATE (self); + g_return_if_fail (priv != NULL); + priv->folder_type = folder_type; +} + static TnyFolderType tny_merge_folder_get_folder_type (TnyFolder *self) { - return TNY_FOLDER_TYPE_MERGE; + TnyMergeFolderPriv *priv = TNY_MERGE_FOLDER_GET_PRIVATE (self); + g_return_val_if_fail (priv != NULL, TNY_FOLDER_TYPE_MERGE); + return priv->folder_type; } static guint @@ -1005,6 +1016,7 @@ priv->lock = g_new0 (GStaticRecMutex, 1); g_static_rec_mutex_init (priv->lock); priv->observers = NULL; + priv->folder_type = TNY_FOLDER_TYPE_MERGE; return; } Index: libtinymail/tny-merge-folder.h =================================================================== --- libtinymail/tny-merge-folder.h (revision 2378) +++ libtinymail/tny-merge-folder.h (working copy) @@ -58,6 +58,7 @@ TnyFolder* tny_merge_folder_new (void); void tny_merge_folder_add_folder (TnyMergeFolder *self, TnyFolder *folder); +void tny_merge_folder_set_folder_type (TnyMergeFolder *self, TnyFolderType folder_type); G_END_DECLS
Attachment:
signature.asc
Description: OpenPGP digital signature