Some fixes



Hi,

playing with folder copies I noticed that tinymail was not notifying the
UI about the deleted folder, I added the needed coded to the
TnyCamelFolder. The folder store used to create the change object was
also wrong.

I changed also a little bit the deleter method of
TnyGtkFolderStoreTreeModel, this method was the responsible of finding
and deleting the removed folder. The problem was that it was always
returning FALSE, so even if you already deleted the folder the
gtk_tree_model_foreach would try to continue, but it wouldn't be able to
because the iter returned by gtk_tree_store_remove is invalid.

Br
Index: libtinymail-camel/tny-camel-folder.c
===================================================================
--- libtinymail-camel/tny-camel-folder.c	(revision 1721)
+++ libtinymail-camel/tny-camel-folder.c	(working copy)
@@ -1583,9 +1583,11 @@
 	fpriv->store = tostore;
 	_tny_camel_folder_set_parent (TNY_CAMEL_FOLDER (retval), into);
 
-	change = tny_folder_store_change_new (TNY_FOLDER_STORE (self));
+	change = tny_folder_store_change_new (into);
 	tny_folder_store_change_add_created_folder (change, retval);
-	notify_folder_store_observers_about (TNY_FOLDER_STORE (self), change);
+	if (del)
+		tny_folder_store_change_add_removed_folder (change, self);
+	notify_folder_store_observers_about (into, change);
 	g_object_unref (G_OBJECT (change));
 
 	camel_object_unref (CAMEL_OBJECT (tostore));
Index: libtinymailui-gtk/tny-gtk-folder-store-tree-model.c
===================================================================
--- libtinymailui-gtk/tny-gtk-folder-store-tree-model.c	(revision 1721)
+++ libtinymailui-gtk/tny-gtk-folder-store-tree-model.c	(working copy)
@@ -599,6 +599,7 @@
 static gboolean 
 deleter (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data1)
 {
+	gboolean retval = FALSE;
 	gint type;
 	GObject *folder = user_data1;
 
@@ -614,13 +615,15 @@
 			TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN, 
 			&fol, -1);
 
-		if (fol == folder)
+		if (fol == folder) {
 			gtk_tree_store_remove (GTK_TREE_STORE (model), iter);
+			retval = TRUE;
+		}
 
 		g_object_unref (G_OBJECT (fol));
 	}
 
-	return FALSE;
+	return retval;
 }


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