Patch that fixes folder additions to the folder store



Hi,

this patch fixes the problem that the tree model has when trying to add a folder that is created just under an account. The old code was not considering this situation.

Br
Index: tny-gtk-folder-store-tree-model.c
===================================================================
--- tny-gtk-folder-store-tree-model.c	(revision 2077)
+++ tny-gtk-folder-store-tree-model.c	(working copy)
@@ -663,29 +663,26 @@
 	{
 		GtkTreeIter child;
 		gint type;
+		TnyFolderStore *fol;
+		gboolean found = FALSE;
 
 		gtk_tree_model_get (model, iter, 
 			TNY_GTK_FOLDER_STORE_TREE_MODEL_TYPE_COLUMN, 
 			&type, -1);
 
-		if (type != TNY_FOLDER_TYPE_ROOT) 
-		{
-			TnyFolderStore *fol;
-			gboolean found = FALSE;
-
-			gtk_tree_model_get (model, iter, 
-				TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN, 
-				&fol, -1);
-
-			if (fol == user_data)
-				found = TRUE;
-
+		gtk_tree_model_get (model, iter, 
+				    TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN, 
+				    &fol, -1);
+		
+		if (fol == user_data)
+			found = TRUE;
+		
+		if (type != TNY_FOLDER_TYPE_ROOT)
 			g_object_unref (G_OBJECT (fol));
 
-			if (found) {
-				*f = *iter;
-				return TRUE;
-			}
+		if (found) {
+			*f = *iter;
+			return TRUE;
 		}
 
 		if (gtk_tree_model_iter_children (model, &child, iter))


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