[Nautilus-list] Another cut of the .directory patch



OK, the following patch eliminates all attempted access to .directory
files on the main thread entirely. It also reduces the amount of
extraneous I/O done for .desktop files. I haven't tried this with
stracing all threads yet (need a 2.4 kernel to ptrace across clone()),
however, or measured if it has any user-visible impact on startup time
(this is probably best tested by someone with a large NFS home
directory). I tested pretty well that it doesn't break anything
obvious (trash state changing still works right for instance).

There are two potential drawbacks to this patch:

* For me at least, the desktop icons appear as generic .desktop icons
before appearing with the right custom image. I can fix this by making
the Nautilus icon view (or at least the desktop icon view) not add
icons to the layout until all the attributes needed to get the right
icon are ready. (Thumbnails would still get created asynchronously).
It depends on how terrible think the desktop icon thing is.

* There were some hacks in the link code to attempt to asynchronously
download references to remote icon images and then fake a notification
so hopefully the icon factory will load it. I don't think anyone uses
this feature and I'll make it get handled by the icon factory when/if
I rework it to be async.


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.4691.2.32
diff -u -p -r1.4691.2.32 ChangeLog
--- ChangeLog	2001/08/18 00:14:42	1.4691.2.32
+++ ChangeLog	2001/08/18 23:49:20
@@ -1,3 +1,102 @@
+2001-08-18  Maciej Stachowiak  <mjs noisehavoc org>
+
+	* libnautilus-private/nautilus-file-attributes.h: Add
+	NAUTILUS_FILE_CUSTOM_NAME attribute.
+
+	* libnautilus-private/nautilus-directory-private.h,
+	libnautilus-private/nautilus-directory-async.c:
+	(link_info_cancel), (nautilus_directory_set_up_request),
+	(nautilus_async_destroying_file), (lacks_link_info),
+	(wants_link_info), (request_is_satisfied), (link_info_done),
+	(link_info_read_done), (link_info_nautilus_link_read_callback),
+	(link_info_gmc_link_read_callback),
+	(link_info_gmc_link_read_more_callback), (make_dot_directory_uri),
+	(link_info_start), (start_or_stop_io),
+	(nautilus_directory_cancel),
+	(cancel_link_info_for_file), (cancel_loading_attributes),
+	(nautilus_directory_cancel_loading_file_attributes): Changes to
+	get the custom name and custom icon out of a link files and
+	.directory files asynchronously and with caching. The I/O is
+	shared with the fetching of the activation URI. 
+
+	* libnautilus-private/nautilus-file-private.h,
+	libnautilus-private/nautilus-file.c: (destroy),
+	(nautilus_file_get_name), (nautilus_file_get_activation_uri),
+	(nautilus_file_get_custom_icon_uri), (invalidate_link_info),
+	(nautilus_file_invalidate_attributes_internal),
+	(nautilus_file_get_all_attributes): Handle new custom_name and
+	custom_icon_uri attributes and link_info internal attribute
+	properly.
+
+	* libnautilus-private/nautilus-file.h: Prototype new
+	nautilus_file_get_custom_icon_uri call.
+
+	* libnautilus-private/nautilus-icon-factory.c
+	(nautilus_icon_factory_get_icon_for_file): Remove code for reading
+	icons from .directory files and various kinds of links. Instead
+	rely on nautilus_file_get_custom_icon_uri.
+
+	* libnautilus-private/nautilus-link.h,
+	libnautilus-private/nautilus-link.c:
+	(nautilus_link_get_link_uri_given_file_contents): Fix to work for
+	classic nautilus links.
+	(nautilus_link_get_link_name_given_file_contents): New call to get
+	a custom name given link contents. (Actually does nothing for
+	old-style nautilus links).
+	(nautilus_link_get_link_icon_given_file_contents): New call to get
+	a custom icon given link contents.
+	(nautilus_link_local_set_icon, nautilus_link_local_set_link_uri):
+	Invalidate the relevant file attributes.
+
+	* libnautilus-private/nautilus-link-impl-desktop.h,
+	libnautilus-private/nautilus-link-impl-desktop.c:
+
+	* libnautilus-private/nautilus-link-impl-desktop.h,
+	libnautilus-private/nautilus-link-impl-desktop.c:
+	(nautilus_link_impl_desktop_local_set_icon): Remve attempt at
+	notification (now done by generic layer).
+	(nautilus_link_impl_desktop_get_link_name_from_desktop,
+	nautilus_link_impl_desktop_get_link_name_given_file_contents):
+	Implement getting the custom name.
+	(nautilus_link_impl_desktop_get_link_icon_from_desktop,
+	nautilus_link_impl_desktop_get_link_icon_given_file_contents):
+	Implement getting the custom icon. This no longer attempts the
+	hack of asynchronously downloading and caching remote
+	icons. Nothing uses this feature and it should really be done in
+	the icon factory, not here.
+
+	* libnautilus-private/nautilus-link-impl.h,
+	libnautilus-private/nautilus-link-impl.c:
+	(nautilus_link_impl_local_set_link_uri): Remove attempt at
+	notification (done by generic layer now).
+	(nautilus_link_impl_get_link_icon_given_file_contents): Implement
+	getting the custom icon. This no longer attempts the hack of
+	asynchronously downloading and caching remote icons. Nothing uses
+	this feature and it should really be done in the icon factory, not
+	here.
+
+	* components/tree/nautilus-tree-model.c:
+	(nautilus_tree_model_monitor_add,
+	nautilus_tree_model_node_begin_monitoring_no_connect): Monitor
+	custom_name and attributes required by icon factory.
+	
+	* src/file-manager/fm-directory-view.c (finish_loading): Monitor
+	custom name attribute.
+
+	* src/file-manager/fm-properties-window.c
+	(create_properties_window): Monitor custom name attribute.
+	
+	* src/file-manager/fm-search-list-view.c (real_adding_file):
+	Monitor custom name attribute.
+
+	* src/nautilus-window-manage-views.c
+	(viewed_file_changed_callback): Always update title even if URI
+	did not change because custom name may have changed or just been
+	retrieved.
+
+	* src/nautilus-window.c: (nautilus_window_set_viewed_file):
+	Monitor custom name attribute,
+
 2001-08-17  Alex Larsson  <alexl redhat com>
 
 	* libnautilus-private/nautilus-file.c (prepend_automatic_emblem_names):
Index: components/tree/nautilus-tree-model.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/tree/nautilus-tree-model.c,v
retrieving revision 1.49
diff -u -p -r1.49 nautilus-tree-model.c
--- components/tree/nautilus-tree-model.c	2001/07/05 23:16:52	1.49
+++ components/tree/nautilus-tree-model.c	2001/08/18 23:49:22
@@ -30,6 +30,7 @@
 #include <gtk/gtksignal.h>
 #include <libgnomevfs/gnome-vfs.h>
 #include <libnautilus-private/nautilus-file-attributes.h>
+#include <libnautilus-private/nautilus-icon-factory.h>
 #include <eel/eel-glib-extensions.h>
 #include <eel/eel-gtk-macros.h>
 #include <stdio.h>
@@ -327,8 +328,10 @@ nautilus_tree_model_monitor_add (Nautilu
 			 "changed",
 			 nautilus_tree_model_root_node_file_monitor,
 			 model);
-		
-		monitor_attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY);
+
+		monitor_attributes = nautilus_icon_factory_get_required_file_attributes ();
+		monitor_attributes = g_list_prepend (monitor_attributes, NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY);
+		monitor_attributes = g_list_prepend (monitor_attributes, NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME);
 		nautilus_file_monitor_add (nautilus_tree_node_get_file (model->details->root_node),
 					   model,
 					   monitor_attributes);
@@ -411,8 +414,10 @@ nautilus_tree_model_node_begin_monitorin
 	if (force_reload) {
 		nautilus_directory_force_reload (directory);
 	}
-
-	monitor_attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY);
+	
+	monitor_attributes = nautilus_icon_factory_get_required_file_attributes ();
+	monitor_attributes = g_list_prepend (monitor_attributes, NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY);
+	monitor_attributes = g_list_prepend (monitor_attributes, NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME);
 	nautilus_directory_file_monitor_add (directory,
 					     model,
 					     TRUE, TRUE,
Index: libnautilus-private/nautilus-directory-async.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-directory-async.c,v
retrieving revision 1.158
diff -u -p -r1.158 nautilus-directory-async.c
--- libnautilus-private/nautilus-directory-async.c	2001/07/05 23:16:53	1.158
+++ libnautilus-private/nautilus-directory-async.c	2001/08/18 23:49:26
@@ -38,6 +38,8 @@
 #include <ctype.h>
 #include <gnome-xml/parser.h>
 #include <gnome-xml/xmlmemory.h>
+#include <libgnome/gnome-metadata.h>
+#include <libgnome/gnome-mime-info.h>
 #include <gtk/gtkmain.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -68,7 +70,7 @@ struct TopLeftTextReadState {
 	EelReadFileHandle *handle;
 };
 
-struct ActivationURIReadState {
+struct LinkInfoReadState {
 	NautilusFile *file;
 	EelReadFileHandle *handle;
 };
@@ -376,14 +378,13 @@ top_left_cancel (NautilusDirectory *dire
 }
 
 static void
-activation_uri_cancel (NautilusDirectory *directory)
+link_info_cancel (NautilusDirectory *directory)
 {
-	if (directory->details->activation_uri_read_state != NULL) {
-		eel_read_file_cancel (directory->details->activation_uri_read_state->handle);
-		g_free (directory->details->activation_uri_read_state);
-		directory->details->activation_uri_read_state = NULL;
-
-		async_job_end (directory, "activation URI");
+	if (directory->details->link_info_read_state != NULL) {
+		eel_read_file_cancel (directory->details->link_info_read_state->handle);
+		g_free (directory->details->link_info_read_state);
+		directory->details->link_info_read_state = NULL;
+		async_job_end (directory, "link info");
 	}
 }
 
@@ -536,14 +537,16 @@ nautilus_directory_set_up_request (Reque
 				NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI,
 				eel_strcmp_compare_func) != NULL) {
 		request->file_info = TRUE;
-		request->activation_uri = TRUE;
+		request->link_info = TRUE;
 	}
-	
-	request->metafile |= g_list_find_custom
-		(file_attributes,
-		 NAUTILUS_FILE_ATTRIBUTE_METADATA,
-		 eel_strcmp_compare_func) != NULL;
 
+	if (g_list_find_custom (file_attributes,
+				NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME,
+				eel_strcmp_compare_func) != NULL) {
+		request->file_info = TRUE;
+		request->link_info = TRUE;
+	}
+
 	/* FIXME bugzilla.eazel.com 2435:
 	 * Some file attributes are really pieces of metadata.
 	 * This is a confusing/broken design, since other metadata
@@ -555,10 +558,19 @@ nautilus_directory_set_up_request (Reque
 	 * directly (would need some funky char trick to prevent
 	 * namespace collisions).
 	 */
+	if (g_list_find_custom (file_attributes,
+				NAUTILUS_FILE_ATTRIBUTE_CUSTOM_ICON,
+				eel_strcmp_compare_func) != NULL) {
+		request->metafile = TRUE;
+		request->file_info = TRUE;
+		request->link_info = TRUE;
+	}
+	
 	request->metafile |= g_list_find_custom
 		(file_attributes,
-		 NAUTILUS_FILE_ATTRIBUTE_CUSTOM_ICON,
+		 NAUTILUS_FILE_ATTRIBUTE_METADATA,
 		 eel_strcmp_compare_func) != NULL;
+
 }
 
 static gboolean
@@ -1484,9 +1496,9 @@ nautilus_async_destroying_file (Nautilus
 		directory->details->top_left_read_state->file = NULL;
 		changed = TRUE;
 	}
-	if (directory->details->activation_uri_read_state != NULL
-	    && directory->details->activation_uri_read_state->file == file) {
-		directory->details->activation_uri_read_state->file = NULL;
+	if (directory->details->link_info_read_state != NULL
+	    && directory->details->link_info_read_state->file == file) {
+		directory->details->link_info_read_state->file = NULL;
 		changed = TRUE;
 	}
 
@@ -1578,16 +1590,16 @@ wants_mime_list (const Request *request)
 }
 
 static gboolean
-lacks_activation_uri (NautilusFile *file)
+lacks_link_info (NautilusFile *file)
 {
 	return file->details->info != NULL
-		&& !file->details->activation_uri_is_up_to_date;
+		&& !file->details->link_info_is_up_to_date;
 }
 
 static gboolean
-wants_activation_uri (const Request *request)
+wants_link_info (const Request *request)
 {
-	return request->activation_uri;
+	return request->link_info;
 }
 
 
@@ -1653,8 +1665,8 @@ request_is_satisfied (NautilusDirectory 
 		}
 	}
 
-	if (request->activation_uri) {
-		if (has_problem (directory, file, lacks_activation_uri)) {
+	if (request->link_info) {
+		if (has_problem (directory, file, lacks_link_info)) {
 			return FALSE;
 		}
 	}
@@ -2693,44 +2705,55 @@ file_info_start (NautilusDirectory *dire
 	gnome_vfs_uri_unref (vfs_uri);
 }
 
+
 static void
-activation_uri_done (NautilusDirectory *directory,
-		     NautilusFile *file,
-		     const char *uri)
+link_info_done (NautilusDirectory *directory,
+		NautilusFile *file,
+		const char *uri,
+		const char *name, 
+		const char *icon)
 {
-	file->details->activation_uri_is_up_to_date = TRUE;
+	file->details->link_info_is_up_to_date = TRUE;
 
-	file->details->got_activation_uri = TRUE;
+	file->details->got_link_info = TRUE;
 	g_free (file->details->activation_uri);
+	g_free (file->details->custom_name);
+	g_free (file->details->custom_icon_uri);
 	file->details->activation_uri = g_strdup (uri);
+	file->details->custom_name = g_strdup (name);
+	file->details->custom_icon_uri = g_strdup (icon);
 
 	nautilus_file_changed (file);
 
-	async_job_end (directory, "activation URI");
+	async_job_end (directory, "link info");
 	nautilus_directory_async_state_changed (directory);
 }
 
+
 static void
-activation_uri_read_done (NautilusDirectory *directory,
-			  const char *uri)
+link_info_read_done (NautilusDirectory *directory,
+		     const char *uri,
+		     const char *name,
+		     const char *icon)
 {
 	NautilusFile *file;
 
-	file = directory->details->activation_uri_read_state->file;
-	g_free (directory->details->activation_uri_read_state);
-	directory->details->activation_uri_read_state = NULL;
+	file = directory->details->link_info_read_state->file;
+	g_free (directory->details->link_info_read_state);
+	directory->details->link_info_read_state = NULL;
 
-	activation_uri_done (directory, file, uri);
+	link_info_done (directory, file, uri, name, icon);
 }
 
+
 static void
-activation_uri_nautilus_link_read_callback (GnomeVFSResult result,
-					    GnomeVFSFileSize bytes_read,
-					    char *file_contents,
-					    gpointer callback_data)
+link_info_nautilus_link_read_callback (GnomeVFSResult result,
+				       GnomeVFSFileSize bytes_read,
+				       char *file_contents,
+				       gpointer callback_data)
 {
 	NautilusDirectory *directory;
-	char *buffer, *uri;
+	char *buffer, *uri, *name, *icon;
 
 	directory = NAUTILUS_DIRECTORY (callback_data);
 
@@ -2741,29 +2764,39 @@ activation_uri_nautilus_link_read_callba
 		/* FIXME bugzilla.eazel.com 2433: We should report this error to the user. */
 		g_free (file_contents);
 		uri = NULL;
+		name = NULL;
+		icon = NULL;
 	} else {
 		/* The gnome-xml parser requires a zero-terminated array. */
 		buffer = g_realloc (file_contents, bytes_read + 1);
 		buffer[bytes_read] = '\0';
 		uri = nautilus_link_get_link_uri_given_file_contents (buffer, bytes_read);
+                name = nautilus_link_get_link_name_given_file_contents (buffer, bytes_read);
+                icon = nautilus_link_get_link_icon_given_file_contents (buffer, bytes_read);
 		g_free (buffer);
 	}
 
-	activation_uri_read_done (directory, uri);
+	link_info_read_done (directory, uri, name, icon);
 	g_free (uri);
+	g_free (name);
+	g_free (icon);
 
 	nautilus_directory_unref (directory);
 }
 
+
+
+
 static void
-activation_uri_gmc_link_read_callback (GnomeVFSResult result,
-				       GnomeVFSFileSize bytes_read,
-				       char *file_contents,
-				       gpointer callback_data)
+link_info_gmc_link_read_callback (GnomeVFSResult result,
+				  GnomeVFSFileSize bytes_read,
+				  char *file_contents,
+				  gpointer callback_data)
 {
 	NautilusDirectory *directory;
-	char *end_of_line, *uri;
-
+	char *end_of_line, *uri, *name, *path, *icon, *icon_path;
+	int size, res;
+	
 	directory = NAUTILUS_DIRECTORY (callback_data);
 
 	nautilus_directory_ref (directory);
@@ -2772,6 +2805,8 @@ activation_uri_gmc_link_read_callback (G
 	if (result != GNOME_VFS_OK || !eel_str_has_prefix (file_contents, "URL: ")) {
 		/* FIXME bugzilla.eazel.com 2433: We should report this error to the user. */
 		uri = NULL;
+		name = NULL;
+		icon = NULL;
 	} else {
 		/* Make sure we don't run off the end of the buffer. */
 		end_of_line = memchr (file_contents, '\n', bytes_read);
@@ -2780,19 +2815,51 @@ activation_uri_gmc_link_read_callback (G
 		} else {
 			uri = g_strndup (file_contents, bytes_read);
 		}
+
+		path = gnome_vfs_get_local_path_from_uri (uri);
+		
+		if (path != NULL) {
+		  /* FIXME: this gnome_metata_get call is synchronous, but better to
+		   * have it here where the results will at least be cached than in
+		   * nautilus_file_get_name. 
+		   */
+		  res = gnome_metadata_get (path, "icon-name", &size, &name);
+		} else {
+		        res = -1;
+		}
+		
+		if (res == 0) {
+		        name = NULL;
+		}
+
+		if (path != NULL) {
+			res = gnome_metadata_get (path, "icon-filename", &size, &icon_path);
+		} else {
+			res = -1;
+		}
+
+		if (res == 0 && icon_path != NULL) {
+			icon = gnome_vfs_get_uri_from_local_path (icon_path);
+			g_free (icon_path);
+		} else {
+			icon = NULL;
+		}
+
 	}
 
 	g_free (file_contents);
-	activation_uri_read_done (directory, uri ? uri + 5 : NULL);
+	link_info_read_done (directory, uri ? uri + 5 : NULL, name, icon);
 	g_free (uri);
+	g_free (name);
+	g_free (icon);
 
 	nautilus_directory_unref (directory);
 }
 
 static gboolean
-activation_uri_gmc_link_read_more_callback (GnomeVFSFileSize bytes_read,
-					    const char *file_contents,
-					    gpointer callback_data)
+link_info_gmc_link_read_more_callback (GnomeVFSFileSize bytes_read,
+				       const char *file_contents,
+				       gpointer callback_data)
 {
 	g_assert (NAUTILUS_IS_DIRECTORY (callback_data));
 
@@ -2800,67 +2867,104 @@ activation_uri_gmc_link_read_more_callba
 	return bytes_read < 512;
 }
 
+
+static char *
+make_dot_directory_uri (const char *uri)
+{
+	char *dot_directory_uri;
+	GnomeVFSURI *vfs_uri;
+	GnomeVFSURI *dot_dir_vfs_uri;
+	
+	/* FIXME: what we really need is a uri_append_file_name call
+	 * that works on strings, so we can avoid the VFS parsing step.
+	 */
+
+	vfs_uri = gnome_vfs_uri_new (uri);
+	dot_dir_vfs_uri = gnome_vfs_uri_append_file_name (vfs_uri, ".directory");
+	dot_directory_uri = gnome_vfs_uri_to_string (dot_dir_vfs_uri, GNOME_VFS_URI_HIDE_NONE);
+	
+	gnome_vfs_uri_unref (vfs_uri);
+	gnome_vfs_uri_unref (dot_dir_vfs_uri);
+
+	return dot_directory_uri;
+}
+
+
+
+
+
 static void
-activation_uri_start (NautilusDirectory *directory)
+link_info_start (NautilusDirectory *directory)
 {
 	NautilusFile *file;
-	char *mime_type, *uri;
-	gboolean gmc_style_link, nautilus_style_link;
+	char *mime_type, *uri, *dot_directory_uri;
+	gboolean gmc_style_link, nautilus_style_link, is_directory;
 
-	/* If there's already a activation URI read in progress, check
+	/* If there's already a link info read in progress, check
 	 * to be sure it's still wanted.
 	 */
-	if (directory->details->activation_uri_read_state != NULL) {
-		file = directory->details->activation_uri_read_state->file;
+	if (directory->details->link_info_read_state != NULL) {
+		file = directory->details->link_info_read_state->file;
 		if (file != NULL) {
 			g_assert (NAUTILUS_IS_FILE (file));
 			g_assert (file->details->directory == directory);
 			if (is_needy (file,
-				      lacks_activation_uri,
-				      wants_activation_uri)) {
+				      lacks_link_info,
+				      wants_link_info)) {
 				return;
 			}
 		}
 
-		/* The count is not wanted, so stop it. */
-		activation_uri_cancel (directory);
+		/* The link info is not wanted, so stop it. */
+		link_info_cancel (directory);
 	}
 
-	/* Figure out which file to get activation_uri for. */
+	/* Figure out which file to get link info for. */
 	file = select_needy_file (directory,
-				  lacks_activation_uri,
-				  wants_activation_uri);
+				  lacks_link_info,
+				  wants_link_info);
 	if (file == NULL) {
 		return;
 	}
 
-	if (!async_job_start (directory, "activation URI")) {
+	if (!async_job_start (directory, "link info")) {
 		return;
 	}
 
 	/* Figure out if it is a link. */
 	mime_type = nautilus_file_get_mime_type (file);
-	gmc_style_link = eel_strcasecmp (mime_type, "application/x-gmc-link") == 0;
+	gmc_style_link = eel_strcasecmp (mime_type, "application/x-gmc-link") == 0 &&
+		nautilus_file_is_in_desktop (file);
 	g_free (mime_type);
 	nautilus_style_link = nautilus_file_is_nautilus_link (file);
+        is_directory = nautilus_file_is_directory (file);
 	
 	/* If it's not a link we are done. If it is, we need to read it. */
-	if (!(gmc_style_link || nautilus_style_link)) {
-		activation_uri_done (directory, file, NULL);
+	if (!(gmc_style_link || nautilus_style_link || is_directory)) {
+		link_info_done (directory, file, NULL, NULL, NULL);
 	} else {
-		directory->details->activation_uri_read_state = g_new0 (ActivationURIReadState, 1);
-		directory->details->activation_uri_read_state->file = file;
+		directory->details->link_info_read_state = g_new0 (LinkInfoReadState, 1);
+		directory->details->link_info_read_state->file = file;
 		uri = nautilus_file_get_uri (file);
 		if (gmc_style_link) {
-			directory->details->activation_uri_read_state->handle = eel_read_file_async
+			directory->details->link_info_read_state->handle = eel_read_file_async
 				(uri,
-				 activation_uri_gmc_link_read_callback,
-				 activation_uri_gmc_link_read_more_callback,
+				 link_info_gmc_link_read_callback,
+				 link_info_gmc_link_read_more_callback,
 				 directory);
+		}  else if (is_directory) {
+			dot_directory_uri = make_dot_directory_uri (uri);
+
+			directory->details->link_info_read_state->handle = eel_read_entire_file_async
+				(dot_directory_uri,
+				 link_info_nautilus_link_read_callback,
+				 directory);
+			
+			g_free (dot_directory_uri);
 		} else {
-			directory->details->activation_uri_read_state->handle = eel_read_entire_file_async
+			directory->details->link_info_read_state->handle = eel_read_entire_file_async
 				(uri,
-				 activation_uri_nautilus_link_read_callback,
+				 link_info_nautilus_link_read_callback,
 				 directory);
 		}
 		g_free (uri);
@@ -2886,10 +2990,11 @@ start_or_stop_io (NautilusDirectory *dir
 	/* Start or stop getting top left pieces of files. */
 	top_left_start (directory);
 
-	/* Start or stop getting activation URIs, which includes
-	 * reading the contents of Nautilus and GMC link files.
+	/* Start or stop getting link info, which includes
+	 * reading the contents of Nautilus and GMC link files,
+	 * as well as .directory files for directories.
 	 */
-	activation_uri_start (directory);
+	link_info_start (directory);
 }
 
 /* Call this when the monitor or call when ready list changes,
@@ -2933,11 +3038,11 @@ void
 nautilus_directory_cancel (NautilusDirectory *directory)
 {
 	/* Arbitrary order (kept alphabetical). */
-	activation_uri_cancel (directory);
 	deep_count_cancel (directory);
 	directory_count_cancel (directory);
 	file_info_cancel (directory);
 	file_list_cancel (directory);
+	link_info_cancel (directory);
 	mime_list_cancel (directory);
 	top_left_cancel (directory);
 
@@ -2997,15 +3102,16 @@ cancel_file_info_for_file (NautilusDirec
 }
 
 static void
-cancel_activation_uri_for_file (NautilusDirectory *directory,
+cancel_link_info_for_file (NautilusDirectory *directory,
 				NautilusFile      *file)
 {
-	if (directory->details->activation_uri_read_state != NULL &&
-	    directory->details->activation_uri_read_state->file == file) {
-		activation_uri_cancel (directory);
+	if (directory->details->link_info_read_state != NULL &&
+	    directory->details->link_info_read_state->file == file) {
+		link_info_cancel (directory);
 	}
 }
 
+
 static void
 cancel_loading_attributes (NautilusDirectory *directory,
 			   GList *file_attributes)
@@ -3030,8 +3136,8 @@ cancel_loading_attributes (NautilusDirec
 	if (request.file_info) {
 		file_info_cancel (directory);
 	}
-	if (request.activation_uri) {
-		file_info_cancel (directory);
+	if (request.link_info) {
+		link_info_cancel (directory);
 	}
 	
 	/* FIXME bugzilla.eazel.com 5064: implement cancelling metadata when we
@@ -3065,8 +3171,8 @@ nautilus_directory_cancel_loading_file_a
 	if (request.file_info) {
 		cancel_file_info_for_file (directory, file);
 	}
-	if (request.activation_uri) {
-		cancel_activation_uri_for_file (directory, file);
+	if (request.link_info) {
+		cancel_link_info_for_file (directory, file);
 	}
 
 	/* FIXME bugzilla.eazel.com 5064: implement cancelling metadata when we
Index: libnautilus-private/nautilus-directory-private.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-directory-private.h,v
retrieving revision 1.82
diff -u -p -r1.82 nautilus-directory-private.h
--- libnautilus-private/nautilus-directory-private.h	2001/07/07 09:19:14	1.82
+++ libnautilus-private/nautilus-directory-private.h	2001/08/18 23:49:26
@@ -35,7 +35,7 @@
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <libnautilus/nautilus-idle-queue.h>
 
-typedef struct ActivationURIReadState ActivationURIReadState;
+typedef struct LinkInfoReadState LinkInfoReadState;
 typedef struct TopLeftTextReadState TopLeftTextReadState;
 typedef struct FileMonitors FileMonitors;
 
@@ -97,14 +97,15 @@ struct NautilusDirectoryDetails
 	GnomeVFSAsyncHandle *get_info_in_progress;
 
 	TopLeftTextReadState *top_left_read_state;
-	ActivationURIReadState *activation_uri_read_state;
 
+	LinkInfoReadState *link_info_read_state;
+
 	GList *file_operations_in_progress; /* list of FileOperation * */
 };
 
 /* A request for information about one or more files. */
 typedef struct {
-	gboolean activation_uri;
+	gboolean link_info;
 	gboolean deep_count;
 	gboolean directory_count;
 	gboolean file_info;
Index: libnautilus-private/nautilus-file-attributes.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-attributes.h,v
retrieving revision 1.15
diff -u -p -r1.15 nautilus-file-attributes.h
--- libnautilus-private/nautilus-file-attributes.h	2000/12/07 01:55:37	1.15
+++ libnautilus-private/nautilus-file-attributes.h	2001/08/18 23:49:27
@@ -29,16 +29,17 @@
  * interest in changes to the attributes or when waiting for them.
  */
 
-#define NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI             "activation URI"
-#define NAUTILUS_FILE_ATTRIBUTE_CAPABILITIES               "capabilities"
-#define NAUTILUS_FILE_ATTRIBUTE_CUSTOM_ICON                "custom icon"
-#define NAUTILUS_FILE_ATTRIBUTE_DEEP_COUNTS                "deep counts"
-#define NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT       "directory item count"
-#define NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_MIME_TYPES  "directory item MIME types"
-#define NAUTILUS_FILE_ATTRIBUTE_FILE_TYPE                  "file type"
-#define NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY               "is directory"
-#define NAUTILUS_FILE_ATTRIBUTE_METADATA                   "metadata"
-#define NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE                  "MIME type"
-#define NAUTILUS_FILE_ATTRIBUTE_TOP_LEFT_TEXT              "top left text"
+#define NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI              "activation URI"
+#define NAUTILUS_FILE_ATTRIBUTE_CAPABILITIES                "capabilities"
+#define NAUTILUS_FILE_ATTRIBUTE_CUSTOM_ICON                 "custom icon"
+#define NAUTILUS_FILE_ATTRIBUTE_DEEP_COUNTS                 "deep counts"
+#define NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT        "directory item count"
+#define NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_MIME_TYPES   "directory item MIME types"
+#define NAUTILUS_FILE_ATTRIBUTE_FILE_TYPE                   "file type"
+#define NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY                "is directory"
+#define NAUTILUS_FILE_ATTRIBUTE_METADATA                    "metadata"
+#define NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE                   "MIME type"
+#define NAUTILUS_FILE_ATTRIBUTE_TOP_LEFT_TEXT               "top left text"
+#define NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME                 "custom name"
 
 #endif /* NAUTILUS_FILE_ATTRIBUTES_H */
Index: libnautilus-private/nautilus-file-private.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-private.h,v
retrieving revision 1.36
diff -u -p -r1.36 nautilus-file-private.h
--- libnautilus-private/nautilus-file-private.h	2001/04/16 23:02:23	1.36
+++ libnautilus-private/nautilus-file-private.h	2001/08/18 23:49:27
@@ -64,6 +64,10 @@ struct NautilusFileDetails
 
 	GList *mime_list; /* If this is a directory, the list of MIME types in it. */
 	char *top_left_text;
+
+	/* Info you might get from a link (.desktop, .directory or nautilus link) */
+	char *custom_name;
+	char *custom_icon_uri;
 	char *activation_uri;
 
 	/* The following is for file operations in progress. Since
@@ -106,8 +110,8 @@ struct NautilusFileDetails
 	eel_boolean_bit got_top_left_text             : 1;
 	eel_boolean_bit top_left_text_is_up_to_date   : 1;
 
-	eel_boolean_bit got_activation_uri            : 1;
-	eel_boolean_bit activation_uri_is_up_to_date  : 1;
+	eel_boolean_bit got_link_info                 : 1;
+	eel_boolean_bit link_info_is_up_to_date       : 1;
 };
 
 NautilusFile *nautilus_file_new_from_info                  (NautilusDirectory      *directory,
Index: libnautilus-private/nautilus-file.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file.c,v
retrieving revision 1.249.2.7
diff -u -p -r1.249.2.7 nautilus-file.c
--- libnautilus-private/nautilus-file.c	2001/08/18 00:14:46	1.249.2.7
+++ libnautilus-private/nautilus-file.c	2001/08/18 23:49:30
@@ -51,7 +51,6 @@
 #include <libgnome/gnome-dentry.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-metadata.h>
-#include <libgnome/gnome-mime-info.h>
 #include <libgnome/gnome-mime.h>
 #include <libgnomevfs/gnome-vfs-file-info.h>
 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
@@ -449,6 +448,8 @@ destroy (GtkObject *object)
 		gnome_vfs_file_info_unref (file->details->info);
 	}
 	g_free (file->details->top_left_text);
+	g_free (file->details->custom_name);
+	g_free (file->details->custom_icon_uri);
 	g_free (file->details->activation_uri);
 	g_free (file->details->compare_by_emblem_cache);
 	
@@ -2258,77 +2259,20 @@ nautilus_file_set_integer_metadata (Naut
 }
 
 
-
-
 char *
 nautilus_file_get_name (NautilusFile *file)
 {
 	char *name;
-	char *path, *uri;
-	char *caption;
-	int size, res;
 
 	if (file == NULL) {
 		return NULL;
 	}
 	g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
-
-	 
-	/* handle .desktop files */
-	if (nautilus_file_is_mime_type (file, "application/x-gnome-app-info")) {
-		uri = nautilus_file_get_uri (file);
-
-		name = NULL;
-		if (nautilus_file_is_local (file)) {
-			name = nautilus_link_impl_desktop_local_get_text (uri);
-		}
-		
-		g_free (uri);
-		uri = NULL;
-		
-		if (name != NULL) {
-			return name;
-		}
-	}
-
-	/* honor .directory found inside a directory */
-	if (nautilus_file_is_directory (file) &&
-	    nautilus_file_is_local (file)) {
-		char *dot_dir_uri;
-		char *file_uri;
-		
-		file_uri = nautilus_file_get_uri (file);
-		dot_dir_uri = nautilus_make_path (file_uri, ".directory");
-		g_free (file_uri);
-		
-		name = nautilus_link_impl_desktop_local_get_text (dot_dir_uri);
-		g_free (dot_dir_uri);
 
-		if (name != NULL)
-			return name;
+	if (file->details->got_link_info && file->details->custom_name != NULL) {
+		return g_strdup (file->details->custom_name);
 	}
 	
-	/* Desktop directories contain special "URL" files, handle
-	 * those by using the gnome metadata caption.
-	 */
-	if (nautilus_file_is_gmc_url (file)) {
-		uri = nautilus_file_get_uri (file);
-		path = gnome_vfs_get_local_path_from_uri (uri);
-
-		if (path != NULL) {
-			res = gnome_metadata_get (path, "icon-caption", &size, &caption);
-		} else {
-			res = -1;
-		}
-		
-		g_free (path);
-		g_free (uri);
-
-		if (res == 0 && caption != NULL) {
-			return caption;
-		}
-	}
-
 	name = gnome_vfs_unescape_string (file->details->relative_uri, "/");
 	if (name != NULL) {
 		return name;
@@ -2376,7 +2320,7 @@ nautilus_file_get_activation_uri (Nautil
 {
 	g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
 
-	if (!file->details->got_activation_uri) {
+	if (!file->details->got_link_info) {
 		return NULL;
 	}
 	return file->details->activation_uri == NULL
@@ -2384,6 +2328,26 @@ nautilus_file_get_activation_uri (Nautil
 		: g_strdup (file->details->activation_uri);
 }
 
+char *
+nautilus_file_get_custom_icon_uri (NautilusFile *file)
+{
+	char *uri;
+
+	g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
+	
+	uri = NULL;
+
+	/* Metadata takes precedence */
+	uri = nautilus_file_get_metadata (file, NAUTILUS_METADATA_KEY_CUSTOM_ICON, NULL);
+
+	if (uri == NULL && file->details->got_link_info) {
+		uri = g_strdup (file->details->custom_icon_uri);
+	}
+
+	return uri;
+}
+
+
 /* Return the actual uri associated with the passed-in file. */
 char *
 nautilus_file_get_uri (NautilusFile *file)
@@ -4876,12 +4840,11 @@ invalidate_file_info (NautilusFile *file
 }
 
 static void
-invalidate_activation_uri (NautilusFile *file)
+invalidate_link_info (NautilusFile *file)
 {
-	file->details->activation_uri_is_up_to_date = FALSE;
+	file->details->link_info_is_up_to_date = FALSE;
 }
 
-
 void
 nautilus_file_invalidate_attributes_internal (NautilusFile *file,
 					      GList *file_attributes)
@@ -4909,8 +4872,8 @@ nautilus_file_invalidate_attributes_inte
 	if (request.top_left_text) {
 		invalidate_top_left_text (file);
 	}
-	if (request.activation_uri) {
-		invalidate_activation_uri (file);
+	if (request.link_info) {
+		invalidate_link_info (file);
 	}
 
 	/* FIXME bugzilla.eazel.com 5075: implement invalidating metadata */
@@ -4959,6 +4922,7 @@ nautilus_file_get_all_attributes (void)
         attributes = g_list_prepend (attributes, NAUTILUS_FILE_ATTRIBUTE_METADATA);
         attributes = g_list_prepend (attributes, NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE);
         attributes = g_list_prepend (attributes, NAUTILUS_FILE_ATTRIBUTE_TOP_LEFT_TEXT);
+        attributes = g_list_prepend (attributes, NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME);
 
 	return attributes;
 }
Index: libnautilus-private/nautilus-file.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file.h,v
retrieving revision 1.80
diff -u -p -r1.80 nautilus-file.h
--- libnautilus-private/nautilus-file.h	2001/04/27 00:03:25	1.80
+++ libnautilus-private/nautilus-file.h	2001/08/18 23:49:31
@@ -290,6 +290,9 @@ GList                  *nautilus_file_li
  */
 char *                  nautilus_file_get_activation_uri                (NautilusFile                   *file);
 
+/* Get custom icon (if specified by metadata or link contents) */
+char *                  nautilus_file_get_custom_icon_uri               (NautilusFile                   *file);
+
 /* Convenience functions for dealing with a list of NautilusFile objects that each have a ref.
  * These are just convenient names for functions that work on lists of GtkObject *.
  */
Index: libnautilus-private/nautilus-icon-factory.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-factory.c,v
retrieving revision 1.222.2.2
diff -u -p -r1.222.2.2 nautilus-icon-factory.c
--- libnautilus-private/nautilus-icon-factory.c	2001/07/24 18:57:12	1.222.2.2
+++ libnautilus-private/nautilus-icon-factory.c	2001/08/18 23:49:33
@@ -36,7 +36,6 @@
 #include "nautilus-lib-self-check-functions.h"
 #include "nautilus-link.h"
 #include "nautilus-link-impl-desktop.h"
-#include "nautilus-metadata.h"
 #include "nautilus-theme.h"
 #include "nautilus-thumbnails.h"
 #include "nautilus-trash-monitor.h"
@@ -55,7 +54,6 @@
 #include <gtk/gtksignal.h>
 #include <libgnome/gnome-dentry.h>
 #include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-metadata.h>
 #include <libgnome/gnome-util.h>
 #include <libgnomevfs/gnome-vfs-file-info.h>
 #include <libgnomevfs/gnome-vfs-mime.h>
@@ -1428,12 +1426,11 @@ is_supported_mime_type (const char *mime
 NautilusScalableIcon *
 nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char *modifier)
 {
-	char *uri, *file_uri, *file_path, *image_uri, *icon_name, *mime_type, *top_left_text;
-	char *directory, *desktop_directory, *buf, *icon_path;
+	char *uri, *file_uri, *icon_name, *mime_type, *top_left_text;
+	int file_size;
  	gboolean is_local;
- 	int file_size, size, res;
  	NautilusScalableIcon *scalable_icon;
-	char *directory_uri;
+	GList *attributes;
 	
 	if (file == NULL) {
 		return NULL;
@@ -1441,8 +1438,13 @@ nautilus_icon_factory_get_icon_for_file 
 
 	icon_name = NULL;
 
-	/* if there is a custom image in the metadata, use that. */
-	uri = nautilus_file_get_metadata (file, NAUTILUS_METADATA_KEY_CUSTOM_ICON, NULL);
+	/* if there is a custom image in the metadata or link info, use that. */
+	uri = nautilus_file_get_custom_icon_uri (file);
+
+	if (uri != NULL && strpbrk (uri, ":/") == NULL) {
+		icon_name = remove_icon_name_suffix (uri);
+	}
+
 	file_uri = nautilus_file_get_uri (file);
 	is_local = nautilus_file_is_local (file);
 	mime_type = nautilus_file_get_mime_type (file);
@@ -1451,37 +1453,6 @@ nautilus_icon_factory_get_icon_for_file 
 	   or use a thumbnail if one exists.  If it's too large, don't try to thumbnail it at all. 
 	   If a thumbnail is required, but does not yet exist,  put an entry on the thumbnail queue so we
 	   eventually make one */
-
-	if (uri == NULL) {
-		/* Do we have to check the gnome metadata?
-		 *
-		 * Do this only for the ~/.gnome-desktop directory, as it was
-		 * the only place where GMC used it (since everywhere else we could
-		 * not do it because of the imlib leaks).
-		 */
-		desktop_directory = nautilus_get_gmc_desktop_directory ();
-		directory_uri = nautilus_file_get_parent_uri (file);
-		directory = gnome_vfs_get_local_path_from_uri (directory_uri);
-		if (directory != NULL && strcmp (directory, desktop_directory) == 0) {
-			file_path = gnome_vfs_get_local_path_from_uri (file_uri);
-
-			if (file_path != NULL) {
-				res = gnome_metadata_get (file_path, "icon-filename", &size, &buf);
-			} else {
-				res = -1;
-			}
-
-			if (res == 0 && buf != NULL) {
-				uri = gnome_vfs_get_uri_from_local_path (buf);
-				g_free (buf);
-			}
-			
-			g_free (file_path);
-		}
-		g_free (directory);
-		g_free (desktop_directory);
-	}
-	
 	/* also, dont make thumbnails for images in the thumbnails directory */  
 	if (uri == NULL) {		
 		file_size = nautilus_file_get_size (file);
@@ -1501,42 +1472,6 @@ nautilus_icon_factory_get_icon_for_file 
 					icon_name = g_strdup (ICON_NAME_THUMBNAIL_LOADING);
 				}
 			}
-		}
-	}
-
-
-	/* .directory files */
-	if (uri == NULL && icon_name == NULL &&
-	    nautilus_file_is_directory (file) &&
-	    /* sync I/O, so locally only */
-	    nautilus_file_is_local (file)) {
-		char *dot_dir_uri;
-		
-		dot_dir_uri = nautilus_make_path (file_uri, ".directory");
-		uri = nautilus_link_impl_desktop_local_get_image_uri (dot_dir_uri);
-		g_free (dot_dir_uri);
-	}
-
-	/* Handle link files, which may specify their own image */
-	if (uri == NULL && icon_name == NULL &&
-	    nautilus_file_is_nautilus_link (file)) {
-		/* FIXME bugzilla.eazel.com 2563: This does sync. I/O and only works for local paths. */
-		image_uri = nautilus_link_local_get_image_uri (file_uri);
-		if (image_uri != NULL) {
-			/* FIXME bugzilla.eazel.com 2564: All custom icons must be in file:. */
-			icon_path = gnome_vfs_get_local_path_from_uri (image_uri);
-			if (icon_path == NULL && image_uri[0] == '/') {
-				icon_path = g_strdup (image_uri);
-			}
-			if (icon_path != NULL) {
-				if (uri == NULL) {
-					uri = gnome_vfs_get_uri_from_local_path (icon_path);
-				}
-				g_free (icon_path);
-			} else if (strpbrk (image_uri, ":/") == NULL) {
-				icon_name = remove_icon_name_suffix (image_uri);
-			}
-			g_free (image_uri);
 		}
 	}
 
Index: libnautilus-private/nautilus-link-impl-desktop.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/Attic/nautilus-link-impl-desktop.c,v
retrieving revision 1.1.2.8
diff -u -p -r1.1.2.8 nautilus-link-impl-desktop.c
--- libnautilus-private/nautilus-link-impl-desktop.c	2001/08/09 01:06:59	1.1.2.8
+++ libnautilus-private/nautilus-link-impl-desktop.c	2001/08/18 23:49:33
@@ -1,3 +1,4 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 #include <config.h>
 #include "nautilus-link.h"
 #include "nautilus-link-impl-desktop.h"
@@ -27,19 +28,7 @@
 #define NAUTILUS_LINK_MOUNT_TAG 	"FSDevice"
 #define NAUTILUS_LINK_HOME_TAG 		"X-nautilus-home"
 
-#define REMOTE_ICON_DIR_PERMISSIONS (GNOME_VFS_PERM_USER_ALL \
-				     | GNOME_VFS_PERM_GROUP_ALL \
-				     | GNOME_VFS_PERM_OTHER_ALL)
 
-
-typedef struct {
-	char *link_uri;
-	char *file_path;
-} NautilusLinkIconNotificationInfo;
-
-typedef void (* NautilusFileFunction) (NautilusFile *file);
-
-
 static char*
 slurp_uri_contents (const char *uri)
 {
@@ -72,89 +61,6 @@ slurp_uri_contents (const char *uri)
 }
 
 
-/* utility to return the local pathname of a cached icon, given the leaf name */
-/* if the icons directory hasn't been created yet, create it */
-static char *
-make_local_path (const char *image_uri)
-{
-	GnomeVFSResult result;
-	
-	char *escaped_uri, *local_directory_path, *local_directory_uri, *local_file_path;
-	
-	escaped_uri = gnome_vfs_escape_slashes (image_uri);		
-	
-	local_directory_path = g_strconcat
-		(g_get_home_dir (),
-		 "/.nautilus/remote_icons",
-		 NULL);
-
-	/* We must create the directory if it doesn't exist. */
-	local_directory_uri = gnome_vfs_get_uri_from_local_path (local_directory_path);
-	result = gnome_vfs_make_directory (local_directory_uri, REMOTE_ICON_DIR_PERMISSIONS);
-	if (result != GNOME_VFS_OK) {
-		g_free (local_directory_uri);
-		g_free (escaped_uri);
-		g_free (local_directory_path);
-		return NULL;
-	}
-			
-	local_file_path = nautilus_make_path (local_directory_path, escaped_uri);
-	g_free (local_directory_uri);
-	g_free (escaped_uri);
-	g_free (local_directory_path);
-
-	return local_file_path;
-}
-
-/* utility to free the icon notification info */
-
-static void
-free_icon_notification_info (NautilusLinkIconNotificationInfo *info)
-{
-	g_free (info->link_uri);
-	g_free (info->file_path);
-	g_free (info);
-}
-
-/* callback to handle the asynchronous reading of icons */
-static void
-icon_read_done_callback (GnomeVFSResult result,
-			 GnomeVFSFileSize file_size,
-			 char *file_contents,
-			 gpointer callback_data)
-{
-	int size;
-	FILE* outfile;
-	NautilusFile *file;
-	NautilusLinkIconNotificationInfo *info;
-	
-	info = (NautilusLinkIconNotificationInfo *) callback_data;
-
-	if (result != GNOME_VFS_OK) {
-		g_assert (file_contents == NULL);
-		free_icon_notification_info (info);
-		return;
-	}
-
-	/* write out the file into the cache area */	
-	size = file_size;
-	outfile = fopen (info->file_path, "wb");	 	
-	fwrite (file_contents, size, 1, outfile);
-	fclose (outfile);
-
-	g_free (file_contents);
-
-	/* tell the world that the file has changed */
-	file = nautilus_file_get (info->link_uri);
-	if (file != NULL) {
-		nautilus_file_changed (file);
-		nautilus_file_unref (file);
-	}
-	
-	/* free up the notification info */	
-	free_icon_notification_info (info);
-}
-
 static const char *
 get_tag (NautilusLinkType type)
 {
@@ -185,8 +91,9 @@ slurp_key_string (const char *path,
 
 	contents = slurp_uri_contents (path);
 
-	if (contents == NULL)
+	if (contents == NULL) {
 		return NULL;
+	}
 	desktop_file = desktop_file_from_string (contents);
 	g_free (contents);
 
@@ -286,7 +193,6 @@ nautilus_link_impl_desktop_local_set_ico
 {
 	DesktopFile *desktop_file;
 	gchar *contents;
-	NautilusFile *file;
 
 	contents = slurp_uri_contents (path);
 	if (contents == NULL)
@@ -300,11 +206,6 @@ nautilus_link_impl_desktop_local_set_ico
 	desktop_file_save (desktop_file, path);
 	desktop_file_free (desktop_file);
 
-	file = nautilus_file_get (path);
-	if (file != NULL) {
-		nautilus_file_changed (file);
-		nautilus_file_unref (file);
-	}
 	return TRUE;
 }
 
@@ -346,66 +247,6 @@ nautilus_link_impl_desktop_local_get_add
 	return retval;
 }
 
-char *
-nautilus_link_impl_desktop_local_get_image_uri (const char *path)
-{
-	char *icon_uri;
-	char *local_path, *local_uri;
-	NautilusLinkIconNotificationInfo *info;
-
-	icon_uri = slurp_key_string (path, "X-Nautilus-Icon", FALSE);
-
-	if (icon_uri == NULL) {
-		gchar *absolute;
-		gchar *icon_name;
-
-		/* Fall back to a standard icon. */
-		icon_name = slurp_key_string (path, "Icon", FALSE);
-		if (icon_name == NULL)
-			return NULL;
-
-		absolute = gnome_pixmap_file (icon_name);
-		if (absolute) {
-			g_free (icon_name);
-			icon_name = absolute;
-		}
-		if (icon_name[0] == '/')
-			icon_uri = gnome_vfs_get_uri_from_local_path (icon_name);
-		else
-			icon_uri = NULL;
-		g_free (icon_name);
-
-		return icon_uri;
-	}
-
-	/* if the image is remote, see if we can find it in our local cache */
-	if (eel_is_remote_uri (icon_uri)) {
-		local_path = make_local_path (icon_uri);
-		if (local_path == NULL) {
-			g_free (icon_uri);
-			return NULL;
-		}
-		if (g_file_exists (local_path)) {
-			g_free (icon_uri);			
-			local_uri = gnome_vfs_get_uri_from_local_path (local_path);
-			g_free (local_path);
-			return local_uri;	
-		}
-	 
-		/* load it asynchronously through gnome-vfs */
-	        info = g_new0 (NautilusLinkIconNotificationInfo, 1);
-		info->link_uri = gnome_vfs_get_uri_from_local_path (path);
-		info->file_path = g_strdup (local_path);
-		eel_read_entire_file_async (icon_uri, icon_read_done_callback, info);
-		
-		g_free (icon_uri);
-  		g_free (local_path);
-		return NULL; /* return NULL since the icon is still loading - it will get correctly set by the callback */
-	}
-	
-	return icon_uri;
-}
-
 NautilusLinkType
 nautilus_link_impl_desktop_local_get_link_type (const char *path)
 {
@@ -498,6 +339,57 @@ nautilus_link_impl_desktop_get_link_uri_
 	return retval;
 }
 
+static gchar *
+nautilus_link_impl_desktop_get_link_name_from_desktop (DesktopFile *desktop_file)
+{
+	gchar *name;
+
+	name = NULL;
+
+	if (desktop_file_get_string (desktop_file,
+				     "Desktop Entry",
+				     "Name",
+				     &name)) {
+	         return name;
+	} else {
+	         return NULL;
+	}
+}
+
+static gchar *
+nautilus_link_impl_desktop_get_link_icon_from_desktop (DesktopFile *desktop_file)
+{
+	char *icon_uri;
+	gchar *absolute;
+	gchar *icon_name;
+
+	if (desktop_file_get_string (desktop_file, "Desktop Entry", "X-Nautilus-Icon", &icon_uri)) {
+		printf ("icon uri: %s\n", icon_uri);
+		return icon_uri;
+	}
+
+	/* Fall back to a standard icon. */
+	if (desktop_file_get_string (desktop_file, "Desktop Entry", "Icon", &icon_name)) {
+		if (icon_name == NULL) {
+			return NULL;
+		}
+	
+		absolute = gnome_pixmap_file (icon_name);
+		if (absolute) {
+			g_free (icon_name);
+			icon_name = absolute;
+		}
+		if (icon_name[0] == '/')
+			icon_uri = gnome_vfs_get_uri_from_local_path (icon_name);
+		else
+			icon_uri = NULL;
+		g_free (icon_name);
+
+		return icon_uri;
+	}
+
+	return NULL;
+}
 
 char *
 nautilus_link_impl_desktop_local_get_link_uri (const char *path)
@@ -537,8 +429,49 @@ nautilus_link_impl_desktop_get_link_uri_
 
 	desktop_file_free (desktop_file);
 	return retval;
-	
 }
+
+char *
+nautilus_link_impl_desktop_get_link_name_given_file_contents (const char *link_file_contents,
+							      int         link_file_size)
+{
+	DesktopFile *desktop_file;
+	gchar *slurp;
+	gchar *retval;
+
+	slurp = g_strndup (link_file_contents, link_file_size);
+	desktop_file = desktop_file_from_string (slurp);
+	g_free (slurp);
+	if (desktop_file == NULL) {
+		return NULL; 
+	}
+	retval = nautilus_link_impl_desktop_get_link_name_from_desktop (desktop_file);
+
+	desktop_file_free (desktop_file);
+	return retval;
+}
+
+
+char *
+nautilus_link_impl_desktop_get_link_icon_given_file_contents (const char *link_file_contents,
+							      int         link_file_size)
+{
+	DesktopFile *desktop_file;
+	gchar *slurp;
+	gchar *retval;
+
+	slurp = g_strndup (link_file_contents, link_file_size);
+	desktop_file = desktop_file_from_string (slurp);
+	g_free (slurp);
+	if (desktop_file == NULL) {
+		return NULL; 
+	}
+	retval = nautilus_link_impl_desktop_get_link_icon_from_desktop (desktop_file);
+
+	desktop_file_free (desktop_file);
+	return retval;
+}
+
 
 void
 nautilus_link_impl_desktop_local_create_from_gnome_entry    (GnomeDesktopEntry *entry,
Index: libnautilus-private/nautilus-link-impl-desktop.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/Attic/nautilus-link-impl-desktop.h,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 nautilus-link-impl-desktop.h
--- libnautilus-private/nautilus-link-impl-desktop.h	2001/07/24 18:57:12	1.1.2.1
+++ libnautilus-private/nautilus-link-impl-desktop.h	2001/08/18 23:49:33
@@ -45,7 +45,6 @@ gboolean         nautilus_link_impl_desk
 									      const char        *uri);
 char *           nautilus_link_impl_desktop_local_get_text                   (const char        *path);
 char *           nautilus_link_impl_desktop_local_get_additional_text        (const char        *path);
-char *           nautilus_link_impl_desktop_local_get_image_uri              (const char        *path);
 NautilusLinkType nautilus_link_impl_desktop_local_get_link_type              (const char        *path);
 gboolean         nautilus_link_impl_desktop_local_is_volume_link             (const char        *path);
 gboolean         nautilus_link_impl_desktop_local_is_home_link               (const char        *path);
@@ -53,6 +52,10 @@ gboolean         nautilus_link_impl_desk
 char *           nautilus_link_impl_desktop_local_get_link_uri               (const char        *path);
 char *           nautilus_link_impl_desktop_get_link_uri_given_file_contents (const char        *link_file_contents,
 									      int                link_file_size);
+char *           nautilus_link_impl_desktop_get_link_name_given_file_contents (const char        *link_file_contents,
+									       int                link_file_size);
+char *           nautilus_link_impl_desktop_get_link_icon_given_file_contents (const char        *link_file_contents,
+									       int                link_file_size);
 void             nautilus_link_impl_desktop_local_create_from_gnome_entry    (GnomeDesktopEntry *entry,
 									      const char        *dest_path,
 									      const GdkPoint    *position);
Index: libnautilus-private/nautilus-link-impl.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/Attic/nautilus-link-impl.c,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 nautilus-link-impl.c
--- libnautilus-private/nautilus-link-impl.c	2001/07/26 23:15:55	1.1.2.2
+++ libnautilus-private/nautilus-link-impl.c	2001/08/18 23:49:33
@@ -264,6 +264,7 @@ local_set_root_property (const char *uri
 	return TRUE;
 }
 
+
 /* Set the icon for a link file. This can only be called on local
  * paths, and only on files known to be link files.
  */
@@ -277,16 +278,6 @@ nautilus_link_impl_local_set_icon (const
 }
 
 
-static void
-forget_file_activation_uri (NautilusFile *file)
-{
-	GList *attributes;
-
-	attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI);
-	nautilus_file_invalidate_attributes (file, attributes);
-	g_list_free (attributes);
-}
-
 /* Set the link uri for a link file. This can only be called on local
  * paths, and only on files known to be link files.
  */
@@ -296,7 +287,7 @@ nautilus_link_impl_local_set_link_uri (c
 	return local_set_root_property (path,
 					"link",
 					link_uri,
-					forget_file_activation_uri);
+					NULL);
 }
 
 gboolean
@@ -317,140 +308,6 @@ nautilus_link_impl_local_get_additional_
 		(path, NAUTILUS_METADATA_KEY_EXTRA_TEXT);
 }
 
-/* utility to return the local pathname of a cached icon, given the leaf name */
-/* if the icons directory hasn't been created yet, create it */
-static char *
-make_local_path (const char *image_uri)
-{
-	GnomeVFSResult result;
-	
-	char *escaped_uri, *local_directory_path, *local_directory_uri, *local_file_path;
-	
-	escaped_uri = gnome_vfs_escape_slashes (image_uri);		
-	
-	local_directory_path = g_strconcat
-		(g_get_home_dir (),
-		 "/.nautilus/remote_icons",
-		 NULL);
-
-	/* We must create the directory if it doesn't exist. */
-	local_directory_uri = gnome_vfs_get_uri_from_local_path (local_directory_path);
-	result = gnome_vfs_make_directory (local_directory_uri, REMOTE_ICON_DIR_PERMISSIONS);
-	if (result != GNOME_VFS_OK) {
-		g_free (local_directory_uri);
-		g_free (escaped_uri);
-		g_free (local_directory_path);
-		return NULL;
-	}
-			
-	local_file_path = nautilus_make_path (local_directory_path, escaped_uri);
-	g_free (local_directory_uri);
-	g_free (escaped_uri);
-	g_free (local_directory_path);
-
-	return local_file_path;
-}
-
-/* utility to free the icon notification info */
-
-static void
-free_icon_notification_info (NautilusLinkIconNotificationInfo *info)
-{
-	g_free (info->link_uri);
-	g_free (info->file_path);
-	g_free (info);
-}
-
-/* callback to handle the asynchronous reading of icons */
-static void
-icon_read_done_callback (GnomeVFSResult result,
-			 GnomeVFSFileSize file_size,
-			 char *file_contents,
-			 gpointer callback_data)
-{
-	int size;
-	FILE* outfile;
-	NautilusFile *file;
-	NautilusLinkIconNotificationInfo *info;
-	
-	info = (NautilusLinkIconNotificationInfo *) callback_data;
-
-	if (result != GNOME_VFS_OK) {
-		g_assert (file_contents == NULL);
-		free_icon_notification_info (info);
-		return;
-	}
-
-	/* write out the file into the cache area */	
-	size = file_size;
-	outfile = fopen (info->file_path, "wb");	 	
-	fwrite (file_contents, size, 1, outfile);
-	fclose (outfile);
-
-	g_free (file_contents);
-
-	/* tell the world that the file has changed */
-	file = nautilus_file_get (info->link_uri);
-	if (file != NULL) {
-		nautilus_file_changed (file);
-		nautilus_file_unref (file);
-	}
-	
-	/* free up the notification info */	
-	free_icon_notification_info (info);
-}
-
-/* returns the image associated with a link file */
-char *
-nautilus_link_impl_local_get_image_uri (const char *uri)
-{
-	xmlDoc *doc;
-	char *path;
-	char *icon_uri;
-	char *local_path, *local_uri;
-	NautilusLinkIconNotificationInfo *info;
-
-	path = gnome_vfs_get_local_path_from_uri (uri);
-	doc = xmlParseFile (path);
-	g_free (path);
-	if (doc == NULL) {
-		return NULL;
-	}
-	
-	icon_uri = xml_get_root_property (doc, NAUTILUS_METADATA_KEY_CUSTOM_ICON);
-	xmlFreeDoc (doc);
-
-	if (icon_uri == NULL) {
-		return NULL;
-	}
-
-	/* if the image is remote, see if we can find it in our local cache */
-	if (eel_is_remote_uri (icon_uri)) {
-		local_path = make_local_path (icon_uri);
-		if (local_path == NULL) {
-			g_free (icon_uri);
-			return NULL;
-		}
-		if (g_file_exists (local_path)) {
-			g_free (icon_uri);			
-			local_uri = gnome_vfs_get_uri_from_local_path (local_path);
-			g_free (local_path);
-			return local_uri;	
-		}
-	 
-		/* load it asynchronously through gnome-vfs */
-	        info = g_new0 (NautilusLinkIconNotificationInfo, 1);
-		info->link_uri = g_strdup (uri);
-		info->file_path = g_strdup (local_path);
-		eel_read_entire_file_async (icon_uri, icon_read_done_callback, info);
-		
-		g_free (icon_uri);
-  		g_free (local_path);
-		return NULL; /* return NULL since the icon is still loading - it will get correctly set by the callback */
-	}
-	
-	return icon_uri;
-}
 
 /* Returns the link uri associated with a link file. */
 char *
@@ -482,6 +339,21 @@ nautilus_link_impl_get_link_uri_given_fi
 	return property;
 }
 
+
+char *
+nautilus_link_impl_get_link_icon_given_file_contents (const char *file_contents,
+						      int         file_size)
+{
+	xmlDoc *doc;
+	char *property;
+	
+	doc = xmlParseMemory ((char *) file_contents, file_size);
+	property = xml_get_root_property (doc, NAUTILUS_METADATA_KEY_CUSTOM_ICON);
+	xmlFreeDoc (doc);
+	return property;
+}
+
+
 gboolean
 nautilus_link_impl_local_is_volume_link (const char *path)
 {
@@ -557,3 +429,5 @@ nautilus_link_impl_local_create_from_gno
 	g_free (launch_string);
 	g_free (arguments);
 }
+
+
Index: libnautilus-private/nautilus-link-impl.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/Attic/nautilus-link-impl.h,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 nautilus-link-impl.h
--- libnautilus-private/nautilus-link-impl.h	2001/07/24 18:57:12	1.1.2.1
+++ libnautilus-private/nautilus-link-impl.h	2001/08/18 23:49:33
@@ -44,13 +44,14 @@ gboolean         nautilus_link_impl_loca
 gboolean         nautilus_link_impl_local_set_link_uri               (const char        *path,
 								      const char        *uri);
 char *           nautilus_link_impl_local_get_additional_text        (const char        *path);
-char *           nautilus_link_impl_local_get_image_uri              (const char        *path);
 NautilusLinkType nautilus_link_impl_local_get_link_type              (const char        *path);
 gboolean         nautilus_link_impl_local_is_volume_link             (const char        *path);
 gboolean         nautilus_link_impl_local_is_home_link               (const char        *path);
 gboolean         nautilus_link_impl_local_is_trash_link              (const char        *path);
 char *           nautilus_link_impl_local_get_link_uri               (const char        *path);
 char *           nautilus_link_impl_get_link_uri_given_file_contents (const char        *link_file_contents,
+								      int                link_file_size);
+char *           nautilus_link_impl_get_link_icon_given_file_contents (const char        *link_file_contents,
 								      int                link_file_size);
 void             nautilus_link_impl_local_create_from_gnome_entry    (GnomeDesktopEntry *entry,
 								      const char        *dest_path,
Index: libnautilus-private/nautilus-link.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-link.c,v
retrieving revision 1.57.2.4
diff -u -p -r1.57.2.4 nautilus-link.c
--- libnautilus-private/nautilus-link.c	2001/08/01 09:24:37	1.57.2.4
+++ libnautilus-private/nautilus-link.c	2001/08/18 23:49:34
@@ -85,6 +85,8 @@ nautilus_link_local_set_icon (const char
 {
 	const gchar *mime_type;
 	gboolean retval;
+	NautilusFile *file;
+	GList *attributes;
 
 	mime_type = get_uri_mime_type_full (path);
 	retval = FALSE;
@@ -98,6 +100,12 @@ nautilus_link_local_set_icon (const char
 		retval = nautilus_link_impl_desktop_local_set_icon (path, icon_name);
 	}
 
+	file = nautilus_file_get (path);
+	attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI);
+	nautilus_file_invalidate_attributes (file, attributes);
+	nautilus_file_unref (file);
+	g_list_free (attributes);
+	
 	return retval;
 }
 
@@ -106,6 +114,8 @@ nautilus_link_local_set_link_uri (const 
 {
 	const gchar *mime_type;
 	gboolean retval;
+	NautilusFile *file;
+	GList *attributes;
 
 	mime_type = get_uri_mime_type_full (path);
 	retval = FALSE;
@@ -119,6 +129,12 @@ nautilus_link_local_set_link_uri (const 
 		retval = nautilus_link_impl_desktop_local_set_link_uri (path, link_uri);
 	}
 
+	file = nautilus_file_get (path);
+	attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI);
+	nautilus_file_invalidate_attributes (file, attributes);
+	nautilus_file_unref (file);
+	g_list_free (attributes);
+
 	return retval;
 }
 
@@ -166,27 +182,6 @@ nautilus_link_local_get_additional_text 
 	return retval;
 }
 
-char *
-nautilus_link_local_get_image_uri (const char *path)
-{
-	const gchar *mime_type;
-	gchar *retval;
-
-	mime_type = get_uri_mime_type_full (path);
-	retval = NULL;
-
-	if (mime_type == NULL)
-		return retval;
-
-	if (strcmp (mime_type, "application/x-nautilus-link") == 0) {
-		retval = nautilus_link_impl_local_get_image_uri (path);
-	} else if (strcmp (mime_type, "application/x-gnome-app-info") == 0) {
-		retval = nautilus_link_impl_desktop_local_get_image_uri (path);
-	}
-
-	return retval;
-}
-
 /* Returns the link uri associated with a link file. */
 char *
 nautilus_link_local_get_link_uri (const char *path)
@@ -235,17 +230,55 @@ char *
 nautilus_link_get_link_uri_given_file_contents (const char *file_contents,
 						int file_size)
 {
-	//	const gchar *mime_type;
+	const gchar *mime_type;
 	gchar *retval;
 
-//	mime_type = get_uri_mime_type_full (file_contents);
+	mime_type = gnome_vfs_get_mime_type_for_data (file_contents, file_size);
 	retval = NULL;
 
-//	if (strcmp (mime_type, "application/x-nautilus-link") == 0) {
-//		retval = nautilus_link_impl_get_link_uri_given_file_contents (file_contents, file_size);
-//	} else if (strcmp (mime_type, "application/x-gnome-app-info") == 0) {
+	if (strcmp (mime_type, "application/x-nautilus-link") == 0) {
+		retval = nautilus_link_impl_get_link_uri_given_file_contents (file_contents, file_size);
+	} else if (strcmp (mime_type, "application/x-gnome-app-info") == 0) {
 		retval = nautilus_link_impl_desktop_get_link_uri_given_file_contents (file_contents, file_size);
-//	}
+	}
+
+	return retval;
+}
+
+char *
+nautilus_link_get_link_name_given_file_contents (const char *file_contents,
+						int file_size)
+{
+	const gchar *mime_type;
+	gchar *retval;
+
+	mime_type = gnome_vfs_get_mime_type_for_data (file_contents, file_size);
+	retval = NULL;
+
+	if (strcmp (mime_type, "application/x-nautilus-link") == 0) {
+		retval = NULL;
+	} else if (strcmp (mime_type, "application/x-gnome-app-info") == 0) {
+		retval = nautilus_link_impl_desktop_get_link_name_given_file_contents (file_contents, file_size);
+	}
+
+	return retval;
+}
+
+char *
+nautilus_link_get_link_icon_given_file_contents (const char *file_contents,
+						int file_size)
+{
+	const gchar *mime_type;
+	gchar *retval;
+
+	mime_type = gnome_vfs_get_mime_type_for_data (file_contents, file_size);
+	retval = NULL;
+
+	if (strcmp (mime_type, "application/x-nautilus-link") == 0) {
+		retval = nautilus_link_impl_get_link_icon_given_file_contents (file_contents, file_size);
+	} else if (strcmp (mime_type, "application/x-gnome-app-info") == 0) {
+		retval = nautilus_link_impl_desktop_get_link_icon_given_file_contents (file_contents, file_size);
+	}
 
 	return retval;
 }
Index: libnautilus-private/nautilus-link.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-link.h,v
retrieving revision 1.19
diff -u -p -r1.19 nautilus-link.h
--- libnautilus-private/nautilus-link.h	2001/02/01 08:36:13	1.19
+++ libnautilus-private/nautilus-link.h	2001/08/18 23:49:34
@@ -78,13 +78,6 @@ gboolean         nautilus_link_local_set
  */
 char *           nautilus_link_local_get_additional_text        (const char       *path);
 
-/* Returns the image associated with a link file. Despite the fact
- * that it takes a URI parameter, works only if the file is local and
- * does sync. I/O on the link, although it does async. on the image
- * and caches if the image is remote.
- */
-char *           nautilus_link_local_get_image_uri              (const char       *path);
-
 /* Returns the link type of a link file.
  * Works only if the file is local and does sync. I/O
  */
@@ -115,9 +108,12 @@ gboolean         nautilus_link_local_is_
 char *           nautilus_link_local_get_link_uri               (const char       *path);
 char *           nautilus_link_get_link_uri_given_file_contents (const char       *link_file_contents,
 								 int               link_file_size);
-
-void		nautilus_link_local_create_from_gnome_entry 	(GnomeDesktopEntry *entry,
-								 const char 	   *dest_path,
-								 const GdkPoint    *position);
+char *           nautilus_link_get_link_name_given_file_contents (const char      *file_contents,
+								  int              link_file_size);
+char *           nautilus_link_get_link_icon_given_file_contents (const char      *file_contents,
+								  int              link_file_size);
+void		 nautilus_link_local_create_from_gnome_entry 	 (GnomeDesktopEntry *entry,
+								  const char 	   *dest_path,
+								  const GdkPoint    *position);
 								 								 
 #endif /* NAUTILUS_LINK_H */
Index: src/nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.267
diff -u -p -r1.267 nautilus-window-manage-views.c
--- src/nautilus-window-manage-views.c	2001/06/26 23:51:52	1.267
+++ src/nautilus-window-manage-views.c	2001/08/18 23:49:36
@@ -523,10 +523,11 @@ viewed_file_changed_callback (NautilusFi
                                 (NAUTILUS_NAVIGATION_BAR (window->navigation_bar),
                                  window->details->location);
 
-                        update_title (window);
                 } else {
                         g_free (new_location);
                 }
+
+                update_title (window);
         }
 }
 
Index: src/nautilus-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window.c,v
retrieving revision 1.335
diff -u -p -r1.335 nautilus-window.c
--- src/nautilus-window.c	2001/06/01 16:27:19	1.335
+++ src/nautilus-window.c	2001/08/18 23:49:38
@@ -69,6 +69,7 @@
 #include <libnautilus-private/nautilus-bonobo-extensions.h>
 #include <libnautilus-private/nautilus-drag-window.h>
 #include <libnautilus-private/nautilus-file-utilities.h>
+#include <libnautilus-private/nautilus-file-attributes.h>
 #include <libnautilus-private/nautilus-global-preferences.h>
 #include <libnautilus-private/nautilus-horizontal-splitter.h>
 #include <libnautilus-private/nautilus-icon-factory.h>
@@ -2272,11 +2273,23 @@ void
 nautilus_window_set_viewed_file (NautilusWindow *window,
 				 NautilusFile *file)
 {
+	GList *attributes;
+
 	if (window->details->viewed_file == file) {
 		return;
 	}
 
+	if (window->details->viewed_file != NULL) {
+		nautilus_file_monitor_remove (window->details->viewed_file,
+					      window);
+	}
+
 	nautilus_file_ref (file);
+
+	attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME);
+	nautilus_file_monitor_add (file, window, attributes);
+	g_list_free (attributes);
+
 	cancel_view_as_callback (window);
 	cancel_chose_component_callback (window);
 	nautilus_file_unref (window->details->viewed_file);
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.463.2.3
diff -u -p -r1.463.2.3 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	2001/07/24 18:57:14	1.463.2.3
+++ src/file-manager/fm-directory-view.c	2001/08/18 23:49:42
@@ -4736,7 +4736,8 @@ finish_loading (FMDirectoryView *view)
 
 	/* Monitor the things needed to get the right icon. Also
 	 * monitor a directory's item count because the "size"
-	 * attribute is based on that, and the file's metadata.
+	 * attribute is based on that, and the file's metadata
+	 * and possible custom name.
 	 */
 	attributes = nautilus_icon_factory_get_required_file_attributes ();
 	attributes = g_list_prepend (attributes,
@@ -4745,6 +4746,8 @@ finish_loading (FMDirectoryView *view)
 				     NAUTILUS_FILE_ATTRIBUTE_METADATA);
 	attributes = g_list_prepend (attributes, 
 				     NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE);
+	attributes = g_list_prepend (attributes, 
+				     NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME);
 
 	nautilus_directory_file_monitor_add (view->details->model,
 					     &view->details->model,
Index: src/file-manager/fm-properties-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-properties-window.c,v
retrieving revision 1.121
diff -u -p -r1.121 fm-properties-window.c
--- src/file-manager/fm-properties-window.c	2001/05/11 01:30:33	1.121
+++ src/file-manager/fm-properties-window.c	2001/08/18 23:49:44
@@ -2132,6 +2132,8 @@ create_properties_window (StartupData *s
 	 * target file.
 	 */
 	attributes = nautilus_icon_factory_get_required_file_attributes ();
+	attributes = g_list_prepend (attributes,
+				     NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME);
 	nautilus_file_monitor_add (window->details->original_file, window, attributes);
 	g_list_free (attributes);
 
Index: src/file-manager/fm-search-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-search-list-view.c,v
retrieving revision 1.76
diff -u -p -r1.76 fm-search-list-view.c
--- src/file-manager/fm-search-list-view.c	2001/05/04 03:14:42	1.76
+++ src/file-manager/fm-search-list-view.c	2001/08/18 23:49:44
@@ -632,7 +632,9 @@ real_adding_file (FMListView *view, Naut
 				   GTK_OBJECT (view));
 	/* Monitor the things needed to get the right
 	 * icon. Also monitor a directory's item count because
-	 * the "size" attribute is based on that, and the file's metadata.  */
+	 * the "size" attribute is based on that, and the file's metadata, and
+	 * possible custom icon.  
+	 */
 	attributes = nautilus_icon_factory_get_required_file_attributes ();		
 	attributes = g_list_prepend (attributes,
 				     NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT);
@@ -640,6 +642,8 @@ real_adding_file (FMListView *view, Naut
 				     NAUTILUS_FILE_ATTRIBUTE_METADATA);
 	attributes = g_list_prepend (attributes, 
 				     NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE);
+	attributes = g_list_prepend (attributes, 
+				     NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME);
 	nautilus_file_monitor_add (file, view, attributes);
 	g_list_free (attributes);
 }




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