Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-vfs/ChangeLog,v
retrieving revision 1.1334.2.62
diff -u -p -u -r1.1334.2.62 ChangeLog
--- ChangeLog	3 Nov 2002 04:21:49 -0000	1.1334.2.62
+++ ChangeLog	4 Nov 2002 20:40:27 -0000
@@ -1,3 +1,12 @@
+2002-10-23  Havoc Pennington  <hp@redhat.com>
+
+	* modules/vfolder/vfolder-common.c (entry_reload_if_needed): If
+	OnlyShowIn field exists but does not contain the string "GNOME",
+	set entry->not_shown = TRUE
+	(folder_list_children): don't include not_shown entries in
+	OnlyUnallocated folders.
+	(query_try_match): don't ever match a not_shown entry.
+
 2002-11-03  Dmitry G. Mastrukov  <dmitry@taurussoft.org>
 
 	* configure.in: Added Belarusian to ALL_LINGUAS
Index: modules/vfolder/vfolder-common.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/modules/vfolder/vfolder-common.c,v
retrieving revision 1.1.4.3
diff -u -p -u -r1.1.4.3 vfolder-common.c
--- modules/vfolder/vfolder-common.c	25 Oct 2002 05:33:02 -0000	1.1.4.3
+++ modules/vfolder/vfolder-common.c	4 Nov 2002 20:40:27 -0000
@@ -61,7 +61,8 @@ entry_new (VFolderInfo *info, 
 	entry->weight = weight;
 
 	entry->dirty = TRUE;
-
+	entry->not_shown = FALSE;
+	
 	/* 
 	 * Lame-O special case .directory handling, as we don't want them
 	 * showing up for all-applications:///.
@@ -201,7 +202,7 @@ static void
 entry_reload_if_needed (Entry *entry)
 {
 	gboolean changed = FALSE;
-	gchar *keywords, *deprecates;
+	gchar *keywords, *deprecates, *onlyshowin;
 	int i;
 
 	if (!entry->dirty)
@@ -211,7 +212,9 @@ entry_reload_if_needed (Entry *entry)
 			       "Categories",
 			       &keywords,
 			       "Deprecates",
-			       &deprecates);
+			       &deprecates,
+			       "OnlyShowIn",
+			       &onlyshowin);
 
 	/* 
 	 * Clear keywords from file, leaving only ones added from 
@@ -267,8 +270,28 @@ entry_reload_if_needed (Entry *entry)
 		g_strfreev (parsed);
 	}
 
+	if (onlyshowin) {
+		char **parsed = g_strsplit (onlyshowin, ";", -1);
+
+		/* If OnlyShowIn exists, then the default is
+		 * that we don't show the entry, unless the
+		 * value includes "GNOME"
+		 */
+		entry->not_shown = TRUE;
+		
+		for (i = 0; parsed[i] != NULL; i++) {
+			if (strcmp (parsed[i], "GNOME") == 0)
+				entry->not_shown = FALSE;
+		}
+
+		/* FIXME do we need to emit some kind of notification here? */
+		
+		g_strfreev (parsed);
+	}
+	
 	g_free (keywords);
 	g_free (deprecates);
+	g_free (onlyshowin);
 
 	entry->dirty = FALSE;
 }
@@ -378,7 +401,9 @@ entry_quick_read_keys (Entry  *entry,
 		       const gchar  *key1,
 		       gchar       **result1,
 		       const gchar  *key2,
-		       gchar       **result2)
+		       gchar       **result2,
+		       const gchar  *key3,
+		       gchar       **result3)
 {
 	GnomeVFSHandle *handle;
 	GnomeVFSFileSize readlen;
@@ -387,7 +412,9 @@ entry_quick_read_keys (Entry  *entry,
 
 	*result1 = NULL;
 	if (key2)
-	  *result2 = NULL;
+		*result2 = NULL;
+	if (key3)
+		*result3 = NULL;
 
 	if (gnome_vfs_open (&handle, 
 			    entry_get_filename (entry), 
@@ -414,6 +441,9 @@ entry_quick_read_keys (Entry  *entry,
 	if (key2)
 		entry_key_val_from_string (fullbuf->str, key2, result2);
 
+	if (key3)
+		entry_key_val_from_string (fullbuf->str, key3, result3);
+	
 	g_string_free (fullbuf, TRUE);
 }
 
@@ -1260,6 +1290,9 @@ folder_list_children (Folder *folder)
 			if (query && !query_try_match (query, folder, entry))
 				continue;
 
+			if (entry->not_shown)
+				continue;
+			
 			g_hash_table_insert (
 				name_hash, 
 				(gchar *) entry_get_displayname (entry),
@@ -1274,6 +1307,8 @@ folder_list_children (Folder *folder)
 				       "SortOrder",
 				       &sortorder,
 				       NULL, 
+				       NULL,
+				       NULL,
 				       NULL);
 		if (sortorder) {
 			list = child_list_prepend_sorted (sortorder,
@@ -1525,6 +1560,9 @@ folder_is_hidden (Folder *folder)
 			if (entry_is_allocated (entry))
 				continue;
 
+			if (entry->not_shown)
+				continue;
+			
 			if (query && !query_try_match (query, folder, entry))
 				continue;
 
@@ -1599,9 +1637,12 @@ query_try_match (Query  *query,
 {
 	GSList *li;
 
+	if (efile->not_shown)
+		return FALSE;
+	
 	if (query == NULL)
 		return TRUE;
-
+	
 	switch (query->type) {
 	case QUERY_OR:
 		for (li = query->val.queries; li != NULL; li = li->next) {
Index: modules/vfolder/vfolder-common.h
===================================================================
RCS file: /cvs/gnome/gnome-vfs/modules/vfolder/vfolder-common.h,v
retrieving revision 1.1.4.3
diff -u -p -u -r1.1.4.3 vfolder-common.h
--- modules/vfolder/vfolder-common.h	25 Oct 2002 05:33:02 -0000	1.1.4.3
+++ modules/vfolder/vfolder-common.h	4 Nov 2002 20:40:27 -0000
@@ -82,6 +82,7 @@ typedef struct {
 
 	guint           dirty : 1;
 	guint           user_private : 1;
+	guint           not_shown : 1; /* OnlyShowIn=SomeOtherDesktop */
 } Entry;
 
 Entry        *entry_new                  (VFolderInfo *info,
@@ -120,7 +121,9 @@ void          entry_quick_read_keys     
 					  const gchar  *key1,
 					  gchar       **value1,
 					  const gchar  *key2,
-					  gchar       **value2);
+					  gchar       **value2,
+					  const gchar  *key3,
+					  gchar       **value3);
 
 void          entry_dump                 (Entry *entry, int indent);
 
