Index: gtk/gtkfilechooserdefault.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfilechooserdefault.c,v
retrieving revision 1.329.2.6
diff -u -r1.329.2.6 gtkfilechooserdefault.c
--- gtk/gtkfilechooserdefault.c	19 Sep 2006 14:15:38 -0000	1.329.2.6
+++ gtk/gtkfilechooserdefault.c	19 Sep 2006 14:31:32 -0000
@@ -1177,7 +1177,7 @@
 	      if (pixbuf)
 		g_object_unref (pixbuf);
 	    }
-	  else
+	  else if (gtk_file_system_path_is_local (impl->file_system, (GtkFilePath *)data))
 	    {
 	      const GtkFilePath *path;
 	      struct ReloadIconsData *info;
@@ -1198,6 +1198,26 @@
 						 info);
 	      impl->reload_icon_handles = g_slist_append (impl->reload_icon_handles, handle);
 	    }
+	  else
+	    {
+	      GtkIconTheme *icon_theme;
+
+	      /* Don't call get_info for remote paths to avoid latency and
+	       * auth dialogs.
+	       * If we switch to a better bookmarks file format (XBEL), we
+	       * should use mime info to get a better icon.
+	       */
+	      icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
+	      pixbuf = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-directory", 
+						 impl->icon_size, 0, NULL);
+
+	      gtk_list_store_set (impl->shortcuts_model, &iter,
+				  SHORTCUTS_COL_PIXBUF, pixbuf,
+				  -1);
+
+	      if (pixbuf)
+		g_object_unref (pixbuf);
+	    }
 	}
     }
   while (gtk_tree_model_iter_next (GTK_TREE_MODEL (impl->shortcuts_model),&iter));
@@ -1430,6 +1450,50 @@
   g_object_unref (handle);
 }
 
+/* FIXME: GtkFileSystem needs a function to split a remote path
+ * into hostname and path components, or maybe just have a 
+ * gtk_file_system_path_get_display_name().
+ *
+ * This function is also used in gtkfilechooserbutton.c
+ */
+gchar *
+_gtk_file_chooser_label_for_uri (const gchar *uri)
+{
+  const gchar *path, *start, *end, *p;
+  gchar *host, *label;
+  
+  start = strstr (uri, "://");
+  start += 3;
+  path = strchr (start, '/');
+  
+  if (path)
+    end = path;
+  else
+    {
+      end = uri + strlen (uri);
+      path = "/";
+    }
+
+  /* strip username */
+  p = strchr (start, '@');
+  if (p && p < end)
+    {
+      start = p + 1;
+    }
+  
+  p = strchr (start, ':');
+  if (p && p < end)
+    end = p;
+  
+  host = g_strndup (start, end - start);
+
+  label = g_strdup_printf (_("%1$s on %2$s"), path, host);
+  
+  g_free (host);
+
+  return label;
+}
+
 /* Inserts a path in the shortcuts tree, making a copy of it; alternatively,
  * inserts a volume.  A position of -1 indicates the end of the tree.
  */
@@ -1447,6 +1511,7 @@
   GdkPixbuf *pixbuf = NULL;
   gpointer data = NULL;
   GtkTreeIter iter;
+  GtkIconTheme *icon_theme;      
 
   profile_start ("start", is_volume ? "volume" : (char *) path);
 
@@ -1457,7 +1522,7 @@
       pixbuf = gtk_file_system_volume_render_icon (impl->file_system, volume, GTK_WIDGET (impl),
 						   impl->icon_size, NULL);
     }
-  else
+  else if (gtk_file_system_path_is_local (impl->file_system, path))
     {
       struct ShortcutsInsertRequest *request;
       GtkFileSystemHandle *handle;
@@ -1496,9 +1561,32 @@
 
       return;
     }
+  else
+    {
+      /* Don't call get_info for remote paths to avoid latency and
+       * auth dialogs.
+       */
+      data = gtk_file_path_copy (path);
+      if (label)
+	label_copy = g_strdup (label);
+      else
+	{
+	  gchar *uri;
+
+	  uri = gtk_file_system_path_to_uri (impl->file_system, path);
 
-  if (!data)
-    data = gtk_file_path_copy (path);
+	  label_copy = _gtk_file_chooser_label_for_uri (uri);
+
+	  g_free (uri);
+	}
+    
+      /* If we switch to a better bookmarks file format (XBEL), we
+       * should use mime info to get a better icon.
+       */
+      icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
+      pixbuf = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-directory", 
+					 impl->icon_size, 0, NULL);
+    }
 
   if (pos == -1)
     gtk_list_store_append (impl->shortcuts_model, &iter);
@@ -1711,6 +1799,7 @@
 
   profile_start ("start", NULL);
 
+
   old_changing_folders = impl->changing_folder;
   impl->changing_folder = TRUE;
 
@@ -1797,7 +1886,6 @@
 
   profile_start ("start", NULL);
         
-
   old_changing_folders = impl->changing_folder;
   impl->changing_folder = TRUE;
 
@@ -6167,6 +6255,8 @@
     {
       GtkFilePath *parent_path;
 
+      g_print ("error domain %s, code %d, message %s\n",
+	       g_quark_to_string (error->domain), error->code, error->message);
       if (!data->original_path)
         {
 	  data->original_path = gtk_file_path_copy (data->path);
@@ -6175,7 +6265,7 @@
 
       /* get parent path and try to change the folder to that */
       if (gtk_file_system_get_parent (impl->file_system, data->path, &parent_path, NULL) &&
-	parent_path)
+	  parent_path != NULL)
         {
 	  gtk_file_path_free (data->path);
 	  data->path = parent_path;
Index: gtk/gtkfilechooserbutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfilechooserbutton.c,v
retrieving revision 1.52.2.4
diff -u -r1.52.2.4 gtkfilechooserbutton.c
--- gtk/gtkfilechooserbutton.c	17 Sep 2006 04:19:05 -0000	1.52.2.4
+++ gtk/gtkfilechooserbutton.c	19 Sep 2006 14:31:33 -0000
@@ -1290,23 +1290,34 @@
 	case ROW_TYPE_CURRENT_FOLDER:
 	  if (data)
 	    {
-	      GtkTreePath *path;
-	      GtkFileSystemHandle *handle;
-	      struct ChangeIconThemeData *info;
-
-	      info = g_new0 (struct ChangeIconThemeData, 1);
-	      info->button = g_object_ref (button);
-	      path = gtk_tree_model_get_path (priv->model, &iter);
-	      info->row_ref = gtk_tree_row_reference_new (priv->model, path);
-	      gtk_tree_path_free (path);
-
-	      handle =
-	        gtk_file_system_get_info (priv->fs, data, GTK_FILE_INFO_ICON,
-					  change_icon_theme_get_info_cb,
-					  info);
-	      button->priv->change_icon_theme_handles =
-		g_slist_append (button->priv->change_icon_theme_handles, handle);
-	      pixbuf = NULL;
+	      if (gtk_file_system_path_is_local (priv->fs, (GtkFilePath *)data))
+		{
+		  GtkTreePath *path;
+		  GtkFileSystemHandle *handle;
+		  struct ChangeIconThemeData *info;		  
+		  
+		  info = g_new0 (struct ChangeIconThemeData, 1);
+		  info->button = g_object_ref (button);
+		  path = gtk_tree_model_get_path (priv->model, &iter);
+		  info->row_ref = gtk_tree_row_reference_new (priv->model, path);
+		  gtk_tree_path_free (path);
+		  
+		  handle =
+		    gtk_file_system_get_info (priv->fs, data, GTK_FILE_INFO_ICON,
+					      change_icon_theme_get_info_cb,
+					      info);
+		  button->priv->change_icon_theme_handles =
+		    g_slist_append (button->priv->change_icon_theme_handles, handle);
+		  pixbuf = NULL;
+		}
+	      else
+		/* Don't call get_info for remote paths to avoid latency and
+		 * auth dialogs.
+		 * If we switch to a better bookmarks file format (XBEL), we
+		 * should use mime info to get a better icon.
+		 */
+		pixbuf = gtk_icon_theme_load_icon (theme, "gnome-fs-regular",
+						   priv->icon_size, 0, NULL);
 	    }
 	  else
 	    pixbuf = gtk_icon_theme_load_icon (theme, FALLBACK_ICON_NAME,
@@ -1465,7 +1476,6 @@
 
   data = g_new0 (struct SetDisplayNameData, 1);
   data->button = g_object_ref (button);
-
   data->label = gtk_file_system_get_bookmark_label (button->priv->fs, path);
 
   tree_path = gtk_tree_model_get_path (button->priv->model, iter);
@@ -1793,6 +1803,8 @@
     }
 }
 
+extern gchar * _gtk_file_chooser_label_for_uri (const gchar *uri);
+
 static void
 model_add_bookmarks (GtkFileChooserButton *button,
 		     GSList               *bookmarks)
@@ -1816,19 +1828,58 @@
 
       path = l->data;
 
-      if (local_only &&
-	  !gtk_file_system_path_is_local (button->priv->fs, path))
-	continue;
+      if (gtk_file_system_path_is_local (button->priv->fs, path))
+	{
+	  gtk_list_store_insert (store, &iter, pos);
+	  gtk_list_store_set (store, &iter,
+			      ICON_COLUMN, NULL,
+			      DISPLAY_NAME_COLUMN, _(FALLBACK_DISPLAY_NAME),
+			      TYPE_COLUMN, ROW_TYPE_BOOKMARK,
+			      DATA_COLUMN, gtk_file_path_copy (path),
+			      IS_FOLDER_COLUMN, FALSE,
+			      -1);
+	  set_info_for_path_at_iter (button, path, &iter);
+	}
+      else
+	{
+	  gchar *label;
+	  GtkIconTheme *icon_theme;
+	  GdkPixbuf *pixbuf;
+
+	  if (local_only)
+	    continue;
+
+	  /* Don't call get_info for remote paths to avoid latency and
+	   * auth dialogs.
+	   * If we switch to a better bookmarks file format (XBEL), we
+	   * should use mime info to get a better icon.
+	   */
+	  label = gtk_file_system_get_bookmark_label (button->priv->fs, path);
+	  if (!label)
+	    {
+	      gchar *uri;
 
-      gtk_list_store_insert (store, &iter, pos);
-      gtk_list_store_set (store, &iter,
-			  ICON_COLUMN, NULL,
-			  DISPLAY_NAME_COLUMN, _(FALLBACK_DISPLAY_NAME),
-			  TYPE_COLUMN, ROW_TYPE_BOOKMARK,
-			  DATA_COLUMN, gtk_file_path_copy (path),
-			  IS_FOLDER_COLUMN, FALSE,
-			  -1);
-      set_info_for_path_at_iter (button, path, &iter);
+	      uri = gtk_file_system_path_to_uri (button->priv->fs, path);
+	      label = _gtk_file_chooser_label_for_uri (uri);
+	      g_free (uri);
+	    }
+
+	  icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (button)));
+	  pixbuf = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-directory", 
+					     button->priv->icon_size, 0, NULL);
+
+	  gtk_list_store_insert (store, &iter, pos);
+	  gtk_list_store_set (store, &iter,
+			      ICON_COLUMN, pixbuf,
+			      DISPLAY_NAME_COLUMN, label,
+			      TYPE_COLUMN, ROW_TYPE_BOOKMARK,
+			      DATA_COLUMN, gtk_file_path_copy (path),
+			      IS_FOLDER_COLUMN, TRUE,
+			      -1);
+
+	  g_free (label);
+	  g_object_unref (pixbuf);
+	}
 
       button->priv->n_bookmarks++;
       pos++;
@@ -1890,14 +1941,53 @@
       model_free_row_data (button, &iter);
     }
 
-  gtk_list_store_set (store, &iter,
-		      ICON_COLUMN, NULL,
-		      DISPLAY_NAME_COLUMN, _(FALLBACK_DISPLAY_NAME),
-		      TYPE_COLUMN, ROW_TYPE_CURRENT_FOLDER,
-		      DATA_COLUMN, gtk_file_path_copy (path),
-		      IS_FOLDER_COLUMN, FALSE,
-		      -1);
-  set_info_for_path_at_iter (button, path, &iter);
+  if (gtk_file_system_path_is_local (button->priv->fs, path))
+    {
+      gtk_list_store_set (store, &iter,
+			  ICON_COLUMN, NULL,
+			  DISPLAY_NAME_COLUMN, _(FALLBACK_DISPLAY_NAME),
+			  TYPE_COLUMN, ROW_TYPE_CURRENT_FOLDER,
+			  DATA_COLUMN, gtk_file_path_copy (path),
+			  IS_FOLDER_COLUMN, FALSE,
+			  -1);
+      set_info_for_path_at_iter (button, path, &iter);
+    }
+  else
+    {
+      gchar *label;
+      GtkIconTheme *icon_theme;
+      GdkPixbuf *pixbuf;
+
+      /* Don't call get_info for remote paths to avoid latency and
+       * auth dialogs.
+       * If we switch to a better bookmarks file format (XBEL), we
+       * should use mime info to get a better icon.
+       */
+      label = gtk_file_system_get_bookmark_label (button->priv->fs, path);
+      if (!label)
+	{
+	  gchar *uri;
+	  
+	  uri = gtk_file_system_path_to_uri (button->priv->fs, path);
+	  label = _gtk_file_chooser_label_for_uri (uri);
+	  g_free (uri);
+	}
+      
+      icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (button)));
+      pixbuf = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-directory", 
+					 button->priv->icon_size, 0, NULL);
+      
+      gtk_list_store_set (store, &iter,
+			  ICON_COLUMN, pixbuf,
+			  DISPLAY_NAME_COLUMN, label,
+			  TYPE_COLUMN, ROW_TYPE_CURRENT_FOLDER,
+			  DATA_COLUMN, gtk_file_path_copy (path),
+			  IS_FOLDER_COLUMN, TRUE,
+			  -1);
+      
+      g_free (label);
+      g_object_unref (pixbuf);
+    }
 }
 
 static inline void
@@ -2009,6 +2099,7 @@
       break;
     case ROW_TYPE_VOLUME:
       {
+	retval = TRUE;
 	if (local_only)
 	  {
 	    if (gtk_file_system_volume_get_is_mounted (priv->fs, data))
@@ -2243,14 +2334,32 @@
 	    goto out;
 	}
 
-      if (priv->update_button_handle)
-	gtk_file_system_cancel_operation (priv->update_button_handle);
+      if (gtk_file_system_path_is_local (priv->fs, path))
+	{
+	  if (priv->update_button_handle)
+	    gtk_file_system_cancel_operation (priv->update_button_handle);
+	  
+	  priv->update_button_handle =
+	    gtk_file_system_get_info (priv->fs, path,
+				      GTK_FILE_INFO_DISPLAY_NAME | GTK_FILE_INFO_ICON,
+				      update_label_get_info_cb,
+				      g_object_ref (button));
+	}
+      else
+	{
+	  GdkPixbuf *pixbuf;
+
+	  label_text = gtk_file_system_get_bookmark_label (button->priv->fs, path);
+	  
+	  pixbuf = gtk_icon_theme_load_icon (get_icon_theme (GTK_WIDGET (priv->image)), 
+					     "gnome-fs-regular",
+					     priv->icon_size, 0, NULL);
+	  
+	  gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf);
 
-      priv->update_button_handle =
-        gtk_file_system_get_info (priv->fs, path,
-				  GTK_FILE_INFO_DISPLAY_NAME | GTK_FILE_INFO_ICON,
-				  update_label_get_info_cb,
-				  g_object_ref (button));
+	  if (pixbuf)
+	    g_object_unref (pixbuf);
+	}
     }
 out:
   gtk_file_paths_free (paths);
