Patch to add a name to a TnyMergeFolder



Hi,

This patch is a major API change that adds a parameter to the
constructor of a merge folder which is the name of the merge folder.

Br
Index: tests/c-demo/tny-demoui-summary-view.c
===================================================================
--- tests/c-demo/tny-demoui-summary-view.c	(revision 2465)
+++ tests/c-demo/tny-demoui-summary-view.c	(working copy)
@@ -937,7 +937,7 @@
 	  }
 	} else {
 		GList *list;
-		TnyFolder *merge = tny_merge_folder_new ();
+		TnyFolder *merge = tny_merge_folder_new ("Merged");
 		GtkTreeView *header_view = GTK_TREE_VIEW (priv->header_view);
 
 		list = gtk_tree_selection_get_selected_rows (priv->mailbox_select, &model);
Index: libtinymail/tny-merge-folder.c
===================================================================
--- libtinymail/tny-merge-folder.c	(revision 2465)
+++ libtinymail/tny-merge-folder.c	(working copy)
@@ -1207,6 +1207,7 @@
 
 /**
  * tny_merge_folder_new:
+ * @folder_name: the name of the merged folder
  *
  * Creates a a new TnyMergeFolder instance that can merge multiple #TnyFolder 
  * instances together (partly read only, though).
@@ -1214,10 +1215,13 @@
  * Return value: a new #TnyMergeFolder instance
  **/
 TnyFolder*
-tny_merge_folder_new (void)
+tny_merge_folder_new (const gchar *folder_name)
 {
 	TnyMergeFolder *self = g_object_new (TNY_TYPE_MERGE_FOLDER, NULL);
+	TnyMergeFolderPriv *priv = TNY_MERGE_FOLDER_GET_PRIVATE (self);
 
+	priv->name = g_strdup (folder_name);
+
 	return TNY_FOLDER (self);
 }
 
@@ -1228,7 +1232,6 @@
 	TnyMergeFolder *self = (TnyMergeFolder *) instance;
 	TnyMergeFolderPriv *priv = TNY_MERGE_FOLDER_GET_PRIVATE (self);
 
-	priv->name = g_strdup ("Merged folder");
 	priv->id = g_strdup  ("");
 	priv->mothers = tny_simple_list_new ();
 	priv->lock = g_new0 (GStaticRecMutex, 1);
Index: libtinymail/tny-merge-folder.h
===================================================================
--- libtinymail/tny-merge-folder.h	(revision 2465)
+++ libtinymail/tny-merge-folder.h	(working copy)
@@ -56,7 +56,7 @@
 
 GType tny_merge_folder_get_type (void);
 
-TnyFolder* tny_merge_folder_new (void);
+TnyFolder* tny_merge_folder_new (const gchar *folder_name);
 void tny_merge_folder_add_folder (TnyMergeFolder *self, TnyFolder *folder);
 void tny_merge_folder_set_folder_type (TnyMergeFolder *self, TnyFolderType folder_type);
 


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