Re: An empty TnyFolderStoreQuery



Philip Van Hoof wrote:
> Note to myself (and whoever cares about it):
> 
> Passing an empty folder store query to the get_folders API of
> TnyFolderStore (not NULL, but a simple empty query instance), will
> result in no folders being allowed by this ghost filter.
> 
> It would be better to let an empty one not filter anything, I think. Or
> have default settings like "only the subscribed folders".

Done. Now it does not filter anything.

Br
Index: libtinymail-camel/tny-camel-common.c
===================================================================
--- libtinymail-camel/tny-camel-common.c	(revision 1286)
+++ libtinymail-camel/tny-camel-common.c	(working copy)
@@ -29,7 +29,7 @@
 {
 	gboolean retval = FALSE;
 
-	if (query)
+	if (query && (tny_list_get_length (tny_folder_store_query_get_items (query)) > 0))
 	{
 		TnyList *items = tny_folder_store_query_get_items (query);
 		TnyIterator *iterator;
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 1286)
+++ ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2006-11-30  Sergio Villar Senin <svillar igalia com>
+	* libtinymail-camel/tny-camel-common.c: a store query with no items
+	filters nothing
+
 2006-11-30  Philip Van Hoof <pvanhoof gnome org>
 
 	* Renamed TnyGtkAccountTreeModel to TnyGtkFolderTreeModel and adapted


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