]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkfilechooserdefault.c
Bug 554690 – mem leak in filechooser
[~andy/gtk] / gtk / gtkfilechooserdefault.c
index de515adbeb3d5aa03f764150531c21fe1bd06074..1248e7b27f09115eb0d50c72a08310784482a27c 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-#include <config.h>
+#include "config.h"
+
 #include "gdk/gdkkeysyms.h"
 #include "gtkalignment.h"
 #include "gtkbindings.h"
-#include "gtkbutton.h"
 #include "gtkcelllayout.h"
 #include "gtkcellrendererpixbuf.h"
 #include "gtkcellrenderertext.h"
@@ -31,7 +31,6 @@
 #include "gtkclipboard.h"
 #include "gtkcombobox.h"
 #include "gtkentry.h"
-#include "gtkeventbox.h"
 #include "gtkexpander.h"
 #include "gtkfilechooserprivate.h"
 #include "gtkfilechooserdefault.h"
 #include "gtkicontheme.h"
 #include "gtkimage.h"
 #include "gtkimagemenuitem.h"
-#include "gtkintl.h"
 #include "gtklabel.h"
 #include "gtkmarshalers.h"
-#include "gtkmenuitem.h"
 #include "gtkmessagedialog.h"
 #include "gtkmountoperation.h"
 #include "gtkpathbar.h"
@@ -69,8 +66,8 @@
 #include "gtktreednd.h"
 #include "gtktreeprivate.h"
 #include "gtktreeselection.h"
-#include "gtktypebuiltins.h"
 #include "gtkvbox.h"
+#include "gtkintl.h"
 
 #include "gtkalias.h"
 
@@ -206,7 +203,8 @@ enum {
   SEARCH_MODEL_COL_FILE,
   SEARCH_MODEL_COL_DISPLAY_NAME,
   SEARCH_MODEL_COL_COLLATION_KEY,
-  SEARCH_MODEL_COL_STAT,
+  SEARCH_MODEL_COL_MTIME,
+  SEARCH_MODEL_COL_SIZE,
   SEARCH_MODEL_COL_CANCELLABLE,
   SEARCH_MODEL_COL_PIXBUF,
   SEARCH_MODEL_COL_MIME_TYPE,
@@ -226,45 +224,8 @@ enum {
 /* Identifiers for target types */
 enum {
   GTK_TREE_MODEL_ROW,
-  TEXT_URI_LIST
-};
-
-/* Target types for dragging from the shortcuts list */
-static const GtkTargetEntry shortcuts_source_targets[] = {
-  { "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, GTK_TREE_MODEL_ROW }
-};
-
-static const int num_shortcuts_source_targets = G_N_ELEMENTS (shortcuts_source_targets); 
-
-/* Target types for dropping into the shortcuts list */
-static const GtkTargetEntry shortcuts_dest_targets[] = {
-  { "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, GTK_TREE_MODEL_ROW },
-  { "text/uri-list", 0, TEXT_URI_LIST }
-};
-
-static const int num_shortcuts_dest_targets = G_N_ELEMENTS (shortcuts_dest_targets); 
-
-/* Target types for DnD from the file list */
-static const GtkTargetEntry file_list_source_targets[] = {
-  { "text/uri-list", 0, TEXT_URI_LIST }
-};
-
-static const int num_file_list_source_targets = G_N_ELEMENTS (file_list_source_targets); 
-
-/* Target types for dropping into the file list */
-static const GtkTargetEntry file_list_dest_targets[] = {
-  { "text/uri-list", GTK_TARGET_OTHER_WIDGET, TEXT_URI_LIST }
-};
-
-static const int num_file_list_dest_targets = G_N_ELEMENTS (file_list_dest_targets); 
-
-/* Target types for dragging from the recent files list */
-static const GtkTargetEntry recent_list_source_targets[] = {
-  { "text/uri-list", 0, TEXT_URI_LIST }
 };
 
-static const int num_recent_list_source_targets = G_N_ELEMENTS (recent_list_source_targets);
-
 static gboolean
 search_is_possible (GtkFileChooserDefault *impl)
 {
@@ -447,13 +408,11 @@ static void list_name_data_func (GtkTreeViewColumn *tree_column,
                                 GtkTreeModel      *tree_model,
                                 GtkTreeIter       *iter,
                                 gpointer           data);
-#if 0
 static void list_size_data_func (GtkTreeViewColumn *tree_column,
                                 GtkCellRenderer   *cell,
                                 GtkTreeModel      *tree_model,
                                 GtkTreeIter       *iter,
                                 gpointer           data);
-#endif
 static void list_mtime_data_func (GtkTreeViewColumn *tree_column,
                                  GtkCellRenderer   *cell,
                                  GtkTreeModel      *tree_model,
@@ -472,6 +431,8 @@ static void location_switch_to_path_bar (GtkFileChooserDefault *impl);
 
 static void     search_stop_searching        (GtkFileChooserDefault *impl,
                                               gboolean               remove_query);
+static void     search_clear_model_row       (GtkTreeModel          *model,
+                                              GtkTreeIter           *iter);
 static void     search_clear_model           (GtkFileChooserDefault *impl, 
                                              gboolean               remove_from_treeview);
 static gboolean search_should_respond        (GtkFileChooserDefault *impl);
@@ -484,7 +445,6 @@ static void     search_get_valid_child_iter  (GtkFileChooserDefault *impl,
                                               GtkTreeIter           *child_iter,
                                               GtkTreeIter           *iter);
 
-static void     recent_manager_update        (GtkFileChooserDefault *impl);
 static void     recent_stop_loading          (GtkFileChooserDefault *impl);
 static void     recent_clear_model           (GtkFileChooserDefault *impl,
                                               gboolean               remove_from_treeview);
@@ -495,6 +455,7 @@ static void     recent_get_valid_child_iter  (GtkFileChooserDefault *impl,
                                               GtkTreeIter           *child_iter,
                                               GtkTreeIter           *iter);
 static void     set_file_system_backend      (GtkFileChooserDefault *impl);
+static void     unset_file_system_backend    (GtkFileChooserDefault *impl);
 
 
 
@@ -611,93 +572,103 @@ _gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class)
   widget_class->size_allocate = gtk_file_chooser_default_size_allocate;
 
   signals[LOCATION_POPUP] =
-    _gtk_binding_signal_new (I_("location-popup"),
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (location_popup_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__STRING,
-                            G_TYPE_NONE, 1, G_TYPE_STRING);
+    g_signal_new_class_handler (I_("location-popup"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (location_popup_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__STRING,
+                                G_TYPE_NONE, 1, G_TYPE_STRING);
+
   signals[LOCATION_POPUP_ON_PASTE] =
-    _gtk_binding_signal_new ("location-popup-on-paste",
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (location_popup_on_paste_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__VOID,
-                            G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("location-popup-on-paste"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (location_popup_on_paste_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
+
   signals[LOCATION_TOGGLE_POPUP] =
-    _gtk_binding_signal_new (I_("location-toggle-popup"),
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (location_toggle_popup_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__VOID,
-                            G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("location-toggle-popup"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (location_toggle_popup_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
+
   signals[UP_FOLDER] =
-    _gtk_binding_signal_new (I_("up-folder"),
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (up_folder_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__VOID,
-                            G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("up-folder"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (up_folder_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
+
   signals[DOWN_FOLDER] =
-    _gtk_binding_signal_new (I_("down-folder"),
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (down_folder_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__VOID,
-                            G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("down-folder"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (down_folder_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
+
   signals[HOME_FOLDER] =
-    _gtk_binding_signal_new (I_("home-folder"),
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (home_folder_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__VOID,
-                            G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("home-folder"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (home_folder_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
+
   signals[DESKTOP_FOLDER] =
-    _gtk_binding_signal_new (I_("desktop-folder"),
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (desktop_folder_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__VOID,
-                            G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("desktop-folder"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (desktop_folder_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
+
   signals[QUICK_BOOKMARK] =
-    _gtk_binding_signal_new (I_("quick-bookmark"),
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (quick_bookmark_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__INT,
-                            G_TYPE_NONE, 1, G_TYPE_INT);
+    g_signal_new_class_handler (I_("quick-bookmark"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (quick_bookmark_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__INT,
+                                G_TYPE_NONE, 1, G_TYPE_INT);
+
   signals[SHOW_HIDDEN] =
-    _gtk_binding_signal_new ("show-hidden",
-                            G_OBJECT_CLASS_TYPE (class),
-                            G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                            G_CALLBACK (show_hidden_handler),
-                            NULL, NULL,
-                            _gtk_marshal_VOID__VOID,
-                            G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("show-hidden"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (show_hidden_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
+
   signals[SEARCH_SHORTCUT] =
-    _gtk_binding_signal_new ("search-shortcut",
-                             G_OBJECT_CLASS_TYPE (class),
-                             G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                             G_CALLBACK (search_shortcut_handler),
-                             NULL, NULL,
-                             _gtk_marshal_VOID__VOID,
-                             G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("search-shortcut"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (search_shortcut_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
+
   signals[RECENT_SHORTCUT] =
-    _gtk_binding_signal_new ("recent-shortcut",
-                             G_OBJECT_CLASS_TYPE (class),
-                             G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
-                             G_CALLBACK (recent_shortcut_handler),
-                             NULL, NULL,
-                             _gtk_marshal_VOID__VOID,
-                             G_TYPE_NONE, 0);
+    g_signal_new_class_handler (I_("recent-shortcut"),
+                                G_OBJECT_CLASS_TYPE (class),
+                                G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+                                G_CALLBACK (recent_shortcut_handler),
+                                NULL, NULL,
+                                _gtk_marshal_VOID__VOID,
+                                G_TYPE_NONE, 0);
 
   binding_set = gtk_binding_set_by_class (class);
 
@@ -823,18 +794,17 @@ _gtk_file_chooser_default_init (GtkFileChooserDefault *impl)
   impl->use_preview_label = TRUE;
   impl->select_multiple = FALSE;
   impl->show_hidden = FALSE;
+  impl->show_size_column = FALSE;
   impl->icon_size = FALLBACK_ICON_SIZE;
   impl->load_state = LOAD_EMPTY;
   impl->reload_state = RELOAD_EMPTY;
   impl->pending_select_files = NULL;
   impl->location_mode = LOCATION_MODE_PATH_BAR;
   impl->operation_mode = OPERATION_MODE_BROWSE;
+  impl->recent_manager = gtk_recent_manager_get_default ();
 
   gtk_box_set_spacing (GTK_BOX (impl), 12);
 
-  impl->tooltips = gtk_tooltips_new ();
-  g_object_ref_sink (impl->tooltips);
-
   set_file_system_backend (impl);
 
   profile_end ("end", NULL);
@@ -868,7 +838,7 @@ shortcuts_free_row_data (GtkFileChooserDefault *impl,
       GtkFileSystemVolume *volume;
 
       volume = col_data;
-      gtk_file_system_volume_free (volume);
+      _gtk_file_system_volume_free (volume);
     }
   else
     {
@@ -954,6 +924,8 @@ gtk_file_chooser_default_finalize (GObject *object)
   GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (object);
   GSList *l;
 
+  unset_file_system_backend (impl);
+
   if (impl->shortcuts_pane_filter_model)
     g_object_unref (impl->shortcuts_pane_filter_model);
 
@@ -962,8 +934,6 @@ gtk_file_chooser_default_finalize (GObject *object)
 
   shortcuts_free (impl);
 
-  g_object_unref (impl->file_system);
-
   g_free (impl->browse_files_last_selected_name);
 
   for (l = impl->filters; l; l = l->next)
@@ -1003,8 +973,6 @@ gtk_file_chooser_default_finalize (GObject *object)
 
   g_free (impl->edited_new_text);
 
-  g_object_unref (impl->tooltips);
-
   G_OBJECT_CLASS (_gtk_file_chooser_default_parent_class)->finalize (object);
 }
 
@@ -1025,7 +993,7 @@ error_message_with_parent (GtkWindow  *parent,
   gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                                            "%s", detail);
 
-  if (parent->group)
+  if (parent && parent->group)
     gtk_window_group_add_window (parent->group, GTK_WINDOW (dialog));
 
   gtk_dialog_run (GTK_DIALOG (dialog));
@@ -1172,7 +1140,7 @@ change_folder_and_display_error (GtkFileChooserDefault *impl,
    * list_row_activated()
    *   fetches path from model; path belongs to the model (*)
    *   calls change_folder_and_display_error()
-   *     calls _gtk_file_chooser_set_current_folder_file()
+   *     calls gtk_file_chooser_set_current_folder_file()
    *       changing folders fails, sets model to NULL, thus freeing the path in (*)
    */
 
@@ -1185,6 +1153,17 @@ change_folder_and_display_error (GtkFileChooserDefault *impl,
   return result;
 }
 
+static void
+emit_default_size_changed (GtkFileChooserDefault *impl)
+{
+  if (!GTK_WIDGET_MAPPED (impl))
+    return;
+
+  profile_msg ("    emit default-size-changed start", NULL);
+  g_signal_emit_by_name (impl, "default-size-changed");
+  profile_msg ("    emit default-size-changed end", NULL);
+}
+
 static void
 update_preview_widget_visibility (GtkFileChooserDefault *impl)
 {
@@ -1213,7 +1192,7 @@ update_preview_widget_visibility (GtkFileChooserDefault *impl)
   else
     gtk_widget_hide (impl->preview_box);
 
-  g_signal_emit_by_name (impl, "default-size-changed");
+  emit_default_size_changed (impl);
 }
 
 static void
@@ -1297,7 +1276,7 @@ shortcuts_reload_icons_get_info_cb (GCancellable *cancellable,
   if (cancelled || error)
     goto out;
 
-  pixbuf = gtk_file_info_render_icon (info, GTK_WIDGET (data->impl), data->impl->icon_size);
+  pixbuf = _gtk_file_info_render_icon (info, GTK_WIDGET (data->impl), data->impl->icon_size);
 
   path = gtk_tree_row_reference_get_path (data->row_ref);
   gtk_tree_model_get_iter (GTK_TREE_MODEL (data->impl->shortcuts_model), &iter, path);
@@ -1357,8 +1336,8 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
              GtkFileSystemVolume *volume;
 
              volume = data;
-             pixbuf = gtk_file_system_volume_render_icon (volume, GTK_WIDGET (impl),
-                                                          impl->icon_size, NULL);
+             pixbuf = _gtk_file_system_volume_render_icon (volume, GTK_WIDGET (impl),
+                                                           impl->icon_size, NULL);
            }
          else if (shortcut_type == SHORTCUT_TYPE_FILE)
             {
@@ -1377,10 +1356,10 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
                  info->row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (impl->shortcuts_model), tree_path);
                  gtk_tree_path_free (tree_path);
 
-                 cancellable = gtk_file_system_get_info (impl->file_system, file,
-                                                         "standard::icon",
-                                                         shortcuts_reload_icons_get_info_cb,
-                                                         info);
+                 cancellable = _gtk_file_system_get_info (impl->file_system, file,
+                                                          "standard::icon",
+                                                          shortcuts_reload_icons_get_info_cb,
+                                                          info);
                  impl->reload_icon_cancellables = g_slist_append (impl->reload_icon_cancellables, cancellable);
                }
               else
@@ -1393,7 +1372,7 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
                   * 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-share", 
+                 pixbuf = gtk_icon_theme_load_icon (icon_theme, "folder-remote", 
                                                     impl->icon_size, 0, NULL);
                }
             }
@@ -1598,8 +1577,8 @@ get_file_info_finished (GCancellable *cancellable,
   
   if (!request->label_copy)
     request->label_copy = g_strdup (g_file_info_get_display_name (info));
-  pixbuf = gtk_file_info_render_icon (info, GTK_WIDGET (request->impl),
-                                     request->impl->icon_size);
+  pixbuf = _gtk_file_info_render_icon (info, GTK_WIDGET (request->impl),
+                                      request->impl->icon_size);
 
   gtk_list_store_set (request->impl->shortcuts_model, &iter,
                      SHORTCUTS_COL_PIXBUF, pixbuf,
@@ -1666,37 +1645,42 @@ _gtk_file_chooser_label_for_file (GFile *file)
   uri = g_file_get_uri (file);
 
   start = strstr (uri, "://");
-  start += 3;
-  path = strchr (start, '/');
-  
-  if (path)
-    end = path;
-  else
+  if (start)
     {
-      end = uri + strlen (uri);
-      path = "/";
-    }
+      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;
-    }
+      /* strip username */
+      p = strchr (start, '@');
+      if (p && p < end)
+        start = p + 1;
   
-  p = strchr (start, ':');
-  if (p && p < end)
-    end = p;
+      p = strchr (start, ':');
+      if (p && p < end)
+        end = p;
   
-  host = g_strndup (start, end - start);
-
-  /* Translators: the first string is a path and the second string 
-   * is a hostname. Nautilus and the panel contain the same string 
-   * to translate. 
-   */
-  label = g_strdup_printf (_("%1$s on %2$s"), path, host);
+      host = g_strndup (start, end - start);
+  
+      /* Translators: the first string is a path and the second string 
+       * is a hostname. Nautilus and the panel contain the same string 
+       * to translate. 
+       */
+      label = g_strdup_printf (_("%1$s on %2$s"), path, host);
+  
+      g_free (host);
+    }
+  else
+    {
+      label = g_strdup (uri);
+    }
   
-  g_free (host);
   g_free (uri);
 
   return label;
@@ -1726,9 +1710,9 @@ shortcuts_insert_file (GtkFileChooserDefault *impl,
   if (shortcut_type == SHORTCUT_TYPE_VOLUME)
     {
       data = volume;
-      label_copy = gtk_file_system_volume_get_display_name (volume);
-      pixbuf = gtk_file_system_volume_render_icon (volume, GTK_WIDGET (impl),
-                                                  impl->icon_size, NULL);
+      label_copy = _gtk_file_system_volume_get_display_name (volume);
+      pixbuf = _gtk_file_system_volume_render_icon (volume, GTK_WIDGET (impl),
+                                                   impl->icon_size, NULL);
     }
   else if (shortcut_type == SHORTCUT_TYPE_FILE)
     {
@@ -1757,9 +1741,9 @@ shortcuts_insert_file (GtkFileChooserDefault *impl,
           request->row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (impl->shortcuts_model), p);
           gtk_tree_path_free (p);
 
-          cancellable = gtk_file_system_get_info (request->impl->file_system, request->file,
-                                                 "standard::is-hidden,standard::display-name,standard::icon",
-                                                 get_file_info_finished, request);
+          cancellable = _gtk_file_system_get_info (request->impl->file_system, request->file,
+                                                  "standard::is-hidden,standard::display-name,standard::icon",
+                                                  get_file_info_finished, request);
 
           gtk_list_store_set (impl->shortcuts_model, &iter,
                              SHORTCUTS_COL_DATA, g_object_ref (file),
@@ -1786,7 +1770,7 @@ shortcuts_insert_file (GtkFileChooserDefault *impl,
            * 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-share", 
+          pixbuf = gtk_icon_theme_load_icon (icon_theme, "folder-remote", 
                                             impl->icon_size, 0, NULL);
         }
     }
@@ -1955,7 +1939,7 @@ shortcuts_append_bookmarks (GtkFileChooserDefault *impl,
 {
   int start_row;
   int num_inserted;
-  const gchar *label;
+  gchar *label;
 
   profile_start ("start", NULL);
 
@@ -1974,9 +1958,11 @@ shortcuts_append_bookmarks (GtkFileChooserDefault *impl,
       if (shortcut_find_position (impl, file) != -1)
         continue;
 
-      label = gtk_file_system_get_bookmark_label (impl->file_system, file);
+      label = _gtk_file_system_get_bookmark_label (impl->file_system, file);
 
       shortcuts_insert_file (impl, start_row + num_inserted, SHORTCUT_TYPE_FILE, NULL, file, label, TRUE, SHORTCUTS_BOOKMARKS);
+      g_free (label);
+
       num_inserted++;
     }
 
@@ -2073,7 +2059,7 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
   shortcuts_remove_rows (impl, start_row, impl->num_volumes);
   impl->num_volumes = 0;
 
-  list = gtk_file_system_list_volumes (impl->file_system);
+  list = _gtk_file_system_list_volumes (impl->file_system);
 
   n = 0;
 
@@ -2085,13 +2071,20 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
 
       if (impl->local_only)
        {
-         if (gtk_file_system_volume_is_mounted (volume))
+         if (_gtk_file_system_volume_is_mounted (volume))
            {
              GFile *base_file;
+              gboolean base_is_native = TRUE;
 
-             base_file = gtk_file_system_volume_get_root (volume);
-             if (base_file != NULL && !g_file_is_native (base_file))
-               continue;
+             base_file = _gtk_file_system_volume_get_root (volume);
+              if (base_file != NULL)
+                {
+                  base_is_native = g_file_is_native (base_file);
+                  g_object_unref (base_file);
+                }
+
+              if (!base_is_native)
+                continue;
            }
        }
 
@@ -2191,7 +2184,7 @@ shortcuts_add_bookmarks (GtkFileChooserDefault *impl)
   impl->num_bookmarks = 0;
   shortcuts_insert_separator (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
 
-  bookmarks = gtk_file_system_list_bookmarks (impl->file_system);
+  bookmarks = _gtk_file_system_list_bookmarks (impl->file_system);
   shortcuts_append_bookmarks (impl, bookmarks);
   g_slist_free (bookmarks);
 
@@ -2261,9 +2254,9 @@ shortcuts_add_current_folder (GtkFileChooserDefault *impl)
 
       pos = shortcuts_get_index (impl, SHORTCUTS_CURRENT_FOLDER);
 
-      volume = gtk_file_system_get_volume_for_file (impl->file_system, impl->current_folder);
+      volume = _gtk_file_system_get_volume_for_file (impl->file_system, impl->current_folder);
       if (volume)
-       base_file = gtk_file_system_volume_get_root (volume);
+       base_file = _gtk_file_system_volume_get_root (volume);
       else
        base_file = NULL;
 
@@ -2503,7 +2496,7 @@ filter_create (GtkFileChooserDefault *impl)
                    G_CALLBACK (filter_combo_changed), impl);
 
   gtk_widget_set_tooltip_text (impl->filter_combo,
-                         _("Select which types of files are shown"));
+                               _("Select which types of files are shown"));
 
   return impl->filter_combo;
 }
@@ -2571,7 +2564,7 @@ shortcut_find_position (GtkFileChooserDefault *impl,
              gboolean exists;
 
              volume = col_data;
-             base_file = gtk_file_system_volume_get_root (volume);
+             base_file = _gtk_file_system_volume_get_root (volume);
 
              exists = base_file && g_file_equal (file, base_file);
 
@@ -2616,7 +2609,7 @@ shortcuts_add_bookmark_from_file (GtkFileChooserDefault *impl,
     return FALSE;
 
   error = NULL;
-  if (!gtk_file_system_insert_bookmark (impl->file_system, file, pos, &error))
+  if (!_gtk_file_system_insert_bookmark (impl->file_system, file, pos, &error))
     {
       error_adding_bookmark_dialog (impl, file, error);
       return FALSE;
@@ -2738,7 +2731,7 @@ remove_selected_bookmarks (GtkFileChooserDefault *impl)
   file = col_data;
 
   error = NULL;
-  if (!gtk_file_system_remove_bookmark (impl->file_system, file, &error))
+  if (!_gtk_file_system_remove_bookmark (impl->file_system, file, &error))
     error_removing_bookmark_dialog (impl, file, error);
 }
 
@@ -3091,7 +3084,7 @@ shortcuts_drag_data_delete_cb (GtkWidget             *widget,
                               GdkDragContext        *context,
                               GtkFileChooserDefault *impl)
 {
-  g_signal_stop_emission_by_name (widget, "drag_data_delete");
+  g_signal_stop_emission_by_name (widget, "drag-data-delete");
 }
 
 #if 0
@@ -3278,7 +3271,7 @@ shortcuts_drag_leave_cb (GtkWidget             *widget,
                                   NULL,
                                   GTK_TREE_VIEW_DROP_BEFORE);
 
-  g_signal_stop_emission_by_name (widget, "drag_leave");
+  g_signal_stop_emission_by_name (widget, "drag-leave");
 }
 
 /* Computes the appropriate row and position for dropping */
@@ -3386,7 +3379,7 @@ shortcuts_drag_motion_cb (GtkWidget             *widget,
 
  out:
 
-  g_signal_stop_emission_by_name (widget, "drag_motion");
+  g_signal_stop_emission_by_name (widget, "drag-motion");
 
   if (action != 0)
     {
@@ -3410,20 +3403,22 @@ shortcuts_drag_drop_cb (GtkWidget             *widget,
   shortcuts_cancel_drag_outside_idle (impl);
 #endif
 
-  g_signal_stop_emission_by_name (widget, "drag_drop");
+  g_signal_stop_emission_by_name (widget, "drag-drop");
   return TRUE;
 }
 
 /* Parses a "text/uri-list" string and inserts its URIs as bookmarks */
 static void
 shortcuts_drop_uris (GtkFileChooserDefault *impl,
-                    const char            *data,
+                    GtkSelectionData      *selection_data,
                     int                    position)
 {
   gchar **uris;
   gint i;
 
-  uris = g_uri_list_extract_uris (data);
+  uris = gtk_selection_data_get_uris (selection_data);
+  if (!uris)
+    return;
 
   for (i = 0; uris[i]; i++)
     {
@@ -3490,10 +3485,10 @@ shortcuts_reorder (GtkFileChooserDefault *impl,
     goto out;
 
   error = NULL;
-  if (gtk_file_system_remove_bookmark (impl->file_system, file, &error))
+  if (_gtk_file_system_remove_bookmark (impl->file_system, file, &error))
     {
       shortcuts_add_bookmark_from_file (impl, file, new_position);
-      gtk_file_system_set_bookmark_label (impl->file_system, file, name);
+      _gtk_file_system_set_bookmark_label (impl->file_system, file, name);
     }
   else
     error_adding_bookmark_dialog (impl, file, error);
@@ -3538,12 +3533,12 @@ shortcuts_drag_data_received_cb (GtkWidget          *widget,
   g_assert (position >= bookmarks_index);
   position -= bookmarks_index;
 
-  if (selection_data->target == gdk_atom_intern_static_string ("text/uri-list"))
-    shortcuts_drop_uris (impl, (const char *) selection_data->data, position);
+  if (gtk_targets_include_uri (&selection_data->target, 1))
+    shortcuts_drop_uris (impl, selection_data, position);
   else if (selection_data->target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
     shortcuts_reorder (impl, position);
 
-  g_signal_stop_emission_by_name (widget, "drag_data_received");
+  g_signal_stop_emission_by_name (widget, "drag-data-received");
 }
 
 /* Callback used to display a tooltip in the shortcuts tree */
@@ -3746,14 +3741,13 @@ shortcuts_build_popup_menu (GtkFileChooserDefault *impl)
                    G_CALLBACK (rename_shortcut_cb), impl);
   gtk_widget_show (item);
   gtk_menu_shell_append (GTK_MENU_SHELL (impl->browse_shortcuts_popup_menu), item);
-
-  shortcuts_check_popup_sensitivity (impl);
 }
 
 static void
 shortcuts_update_popup_menu (GtkFileChooserDefault *impl)
 {
   shortcuts_build_popup_menu (impl);  
+  shortcuts_check_popup_sensitivity (impl);
 }
 
 static void
@@ -3841,7 +3835,7 @@ shortcuts_edited (GtkCellRenderer       *cell,
                      -1);
   gtk_tree_path_free (path);
   
-  gtk_file_system_set_bookmark_label (impl->file_system, shortcut, new_text);
+  _gtk_file_system_set_bookmark_label (impl->file_system, shortcut, new_text);
 }
 
 static void
@@ -3860,6 +3854,11 @@ shortcuts_list_create (GtkFileChooserDefault *impl)
   GtkTreeViewColumn *column;
   GtkCellRenderer *renderer;
 
+  /* Target types for dragging a row to/from the shortcuts list */
+  const GtkTargetEntry tree_model_row_targets[] = {
+    { "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, GTK_TREE_MODEL_ROW }
+  };
+
   /* Scrolled window */
 
   swin = gtk_scrolled_window_new (NULL, NULL);
@@ -3875,11 +3874,11 @@ shortcuts_list_create (GtkFileChooserDefault *impl)
 #ifdef PROFILE_FILE_CHOOSER
   g_object_set_data (G_OBJECT (impl->browse_shortcuts_tree_view), "fmq-name", "shortcuts");
 #endif
-  g_signal_connect (impl->browse_shortcuts_tree_view, "key_press_event",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "key-press-event",
                    G_CALLBACK (tree_view_keybinding_cb), impl);
-  g_signal_connect (impl->browse_shortcuts_tree_view, "popup_menu",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "popup-menu",
                    G_CALLBACK (shortcuts_popup_menu_cb), impl);
-  g_signal_connect (impl->browse_shortcuts_tree_view, "button_press_event",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "button-press-event",
                    G_CALLBACK (shortcuts_button_press_event_cb), impl);
   /* Accessible object name for the file chooser's shortcuts pane */
   atk_object_set_name (gtk_widget_get_accessible (impl->browse_shortcuts_tree_view), _("Places"));
@@ -3888,15 +3887,16 @@ shortcuts_list_create (GtkFileChooserDefault *impl)
 
   gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (impl->browse_shortcuts_tree_view),
                                          GDK_BUTTON1_MASK,
-                                         shortcuts_source_targets,
-                                         num_shortcuts_source_targets,
+                                         tree_model_row_targets,
+                                         G_N_ELEMENTS (tree_model_row_targets),
                                          GDK_ACTION_MOVE);
 
   gtk_drag_dest_set (impl->browse_shortcuts_tree_view,
                     GTK_DEST_DEFAULT_ALL,
-                    shortcuts_dest_targets,
-                    num_shortcuts_dest_targets,
+                    tree_model_row_targets,
+                    G_N_ELEMENTS (tree_model_row_targets),
                     GDK_ACTION_COPY | GDK_ACTION_MOVE);
+  gtk_drag_dest_add_uri_targets (impl->browse_shortcuts_tree_view);
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_shortcuts_tree_view));
   gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
@@ -3907,23 +3907,23 @@ shortcuts_list_create (GtkFileChooserDefault *impl)
   g_signal_connect (selection, "changed",
                    G_CALLBACK (shortcuts_selection_changed_cb), impl);
 
-  g_signal_connect (impl->browse_shortcuts_tree_view, "key_press_event",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "key-press-event",
                    G_CALLBACK (shortcuts_key_press_event_cb), impl);
 
-  g_signal_connect (impl->browse_shortcuts_tree_view, "drag_begin",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "drag-begin",
                    G_CALLBACK (shortcuts_drag_begin_cb), impl);
-  g_signal_connect (impl->browse_shortcuts_tree_view, "drag_end",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "drag-end",
                    G_CALLBACK (shortcuts_drag_end_cb), impl);
-  g_signal_connect (impl->browse_shortcuts_tree_view, "drag_data_delete",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "drag-data-delete",
                    G_CALLBACK (shortcuts_drag_data_delete_cb), impl);
 
-  g_signal_connect (impl->browse_shortcuts_tree_view, "drag_leave",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "drag-leave",
                    G_CALLBACK (shortcuts_drag_leave_cb), impl);
-  g_signal_connect (impl->browse_shortcuts_tree_view, "drag_motion",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "drag-motion",
                    G_CALLBACK (shortcuts_drag_motion_cb), impl);
-  g_signal_connect (impl->browse_shortcuts_tree_view, "drag_drop",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "drag-drop",
                    G_CALLBACK (shortcuts_drag_drop_cb), impl);
-  g_signal_connect (impl->browse_shortcuts_tree_view, "drag_data_received",
+  g_signal_connect (impl->browse_shortcuts_tree_view, "drag-data-received",
                    G_CALLBACK (shortcuts_drag_data_received_cb), impl);
 
   /* Support tooltips */
@@ -4000,7 +4000,7 @@ shortcuts_pane_create (GtkFileChooserDefault *impl,
                                                  G_CALLBACK (add_bookmark_button_clicked_cb));
   gtk_box_pack_start (GTK_BOX (hbox), impl->browse_shortcuts_add_button, TRUE, TRUE, 0);
   gtk_widget_set_tooltip_text (impl->browse_shortcuts_add_button,
-                        _("Add the selected folder to the Bookmarks"));
+                               _("Add the selected folder to the Bookmarks"));
 
   /* Remove bookmark button */
 
@@ -4012,7 +4012,7 @@ shortcuts_pane_create (GtkFileChooserDefault *impl,
                                                     G_CALLBACK (remove_bookmark_button_clicked_cb));
   gtk_box_pack_start (GTK_BOX (hbox), impl->browse_shortcuts_remove_button, TRUE, TRUE, 0);
   gtk_widget_set_tooltip_text (impl->browse_shortcuts_remove_button,
-                        _("Remove the selected bookmark"));
+                               _("Remove the selected bookmark"));
 
   return vbox;
 }
@@ -4102,6 +4102,18 @@ show_hidden_toggled_cb (GtkCheckMenuItem      *item,
                NULL);
 }
 
+/* Callback used when the "Show Size Column" menu item is toggled */
+static void
+show_size_column_toggled_cb (GtkCheckMenuItem *item,
+                             GtkFileChooserDefault *impl)
+{
+  impl->show_size_column = gtk_check_menu_item_get_active (item);
+
+  if (impl->list_size_column)
+    gtk_tree_view_column_set_visible (impl->list_size_column,
+                                      impl->show_size_column);
+}
+
 /* Shows an error dialog about not being able to select a dragged file */
 static void
 error_selecting_dragged_file_dialog (GtkFileChooserDefault *impl,
@@ -4209,10 +4221,17 @@ file_list_drag_data_received_cb (GtkWidget          *widget,
 
   impl = GTK_FILE_CHOOSER_DEFAULT (data);
   chooser = GTK_FILE_CHOOSER (data);
-  
+
+  /* Allow only drags from other widgets; see bug #533891. */
+  if (gtk_drag_get_source_widget (context) == widget)
+    {
+      g_signal_stop_emission_by_name (widget, "drag-data-received");
+      return;
+    }
+
   /* Parse the text/uri-list string, navigate to the first one */
-  uris = g_uri_list_extract_uris ((const char *) selection_data->data);
-  if (uris[0]) 
+  uris = gtk_selection_data_get_uris (selection_data);
+  if (uris && uris[0])
     {
       struct FileListDragData *data;
 
@@ -4228,13 +4247,13 @@ file_list_drag_data_received_cb (GtkWidget          *widget,
        g_cancellable_cancel (impl->file_list_drag_data_received_cancellable);
 
       impl->file_list_drag_data_received_cancellable =
-       gtk_file_system_get_info (impl->file_system, file,
-                                 "standard::type",
-                                 file_list_drag_data_received_get_info_cb,
-                                 data);
+       _gtk_file_system_get_info (impl->file_system, file,
+                                  "standard::type",
+                                  file_list_drag_data_received_get_info_cb,
+                                  data);
     }
 
-  g_signal_stop_emission_by_name (widget, "drag_data_received");
+  g_signal_stop_emission_by_name (widget, "drag-data-received");
 }
 
 /* Don't do anything with the drag_drop signal */
@@ -4246,7 +4265,7 @@ file_list_drag_drop_cb (GtkWidget             *widget,
                        guint                  time_,
                        GtkFileChooserDefault *impl)
 {
-  g_signal_stop_emission_by_name (widget, "drag_drop");
+  g_signal_stop_emission_by_name (widget, "drag-drop");
   return TRUE;
 }
 
@@ -4260,7 +4279,7 @@ file_list_drag_motion_cb (GtkWidget             *widget,
                           guint                  time_,
                           GtkFileChooserDefault *impl)
 {
-  g_signal_stop_emission_by_name (widget, "drag_motion");
+  g_signal_stop_emission_by_name (widget, "drag-motion");
   return TRUE;
 }
 
@@ -4298,6 +4317,13 @@ file_list_build_popup_menu (GtkFileChooserDefault *impl)
                    G_CALLBACK (show_hidden_toggled_cb), impl);
   gtk_widget_show (item);
   gtk_menu_shell_append (GTK_MENU_SHELL (impl->browse_files_popup_menu), item);
+
+  item = gtk_check_menu_item_new_with_mnemonic (_("Show _Size Column"));
+  impl->browse_files_popup_menu_size_column_item = item;
+  g_signal_connect (item, "toggled",
+                    G_CALLBACK (show_size_column_toggled_cb), impl);
+  gtk_widget_show (item);
+  gtk_menu_shell_append (GTK_MENU_SHELL (impl->browse_files_popup_menu), item);
 }
 
 /* Updates the popup menu for the file list, creating it if necessary */
@@ -4312,12 +4338,21 @@ file_list_update_popup_menu (GtkFileChooserDefault *impl)
    * bookmarks_check_add_sensitivity()
    */
 
+  /* 'Show Hidden Files' */
   g_signal_handlers_block_by_func (impl->browse_files_popup_menu_hidden_files_item,
                                   G_CALLBACK (show_hidden_toggled_cb), impl);
   gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (impl->browse_files_popup_menu_hidden_files_item),
                                  impl->show_hidden);
   g_signal_handlers_unblock_by_func (impl->browse_files_popup_menu_hidden_files_item,
                                     G_CALLBACK (show_hidden_toggled_cb), impl);
+
+  /* 'Show Size Column' */
+  g_signal_handlers_block_by_func (impl->browse_files_popup_menu_size_column_item,
+                                  G_CALLBACK (show_size_column_toggled_cb), impl);
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (impl->browse_files_popup_menu_size_column_item),
+                                 impl->show_size_column);
+  g_signal_handlers_unblock_by_func (impl->browse_files_popup_menu_size_column_item,
+                                    G_CALLBACK (show_size_column_toggled_cb), impl);
 }
 
 static void
@@ -4411,19 +4446,21 @@ list_button_press_event_cb (GtkWidget             *widget,
 static void
 file_list_set_sort_column_ids (GtkFileChooserDefault *impl)
 {
-  int name_id, mtime_id;
+  int name_id, mtime_id, size_id;
 
-  name_id = mtime_id = 0;
+  name_id = mtime_id = size_id = 0;
 
   switch (impl->operation_mode)
     {
     case OPERATION_MODE_BROWSE:
       name_id = FILE_LIST_COL_NAME;
       mtime_id = FILE_LIST_COL_MTIME;
+      size_id = FILE_LIST_COL_SIZE;
       break;
     case OPERATION_MODE_SEARCH:
       name_id = SEARCH_MODEL_COL_FILE;
-      mtime_id = SEARCH_MODEL_COL_STAT;
+      mtime_id = SEARCH_MODEL_COL_MTIME;
+      size_id = SEARCH_MODEL_COL_SIZE;
       break;
     case OPERATION_MODE_RECENT:
       name_id = RECENT_MODEL_COL_FILE;
@@ -4433,6 +4470,7 @@ file_list_set_sort_column_ids (GtkFileChooserDefault *impl)
 
   gtk_tree_view_column_set_sort_column_id (impl->list_name_column, name_id);
   gtk_tree_view_column_set_sort_column_id (impl->list_mtime_column, mtime_id);
+  gtk_tree_view_column_set_sort_column_id (impl->list_size_column, size_id);
 }
 
 static gboolean
@@ -4522,7 +4560,6 @@ create_file_list (GtkFileChooserDefault *impl)
   GtkCellRenderer *renderer;
 
   /* Scrolled window */
-
   swin = gtk_scrolled_window_new (NULL, NULL);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
                                  GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
@@ -4543,24 +4580,24 @@ create_file_list (GtkFileChooserDefault *impl)
 
   gtk_drag_dest_set (impl->browse_files_tree_view,
                      GTK_DEST_DEFAULT_ALL,
-                     file_list_dest_targets,
-                     num_file_list_dest_targets,
+                     NULL, 0,
                      GDK_ACTION_COPY | GDK_ACTION_MOVE);
+  gtk_drag_dest_add_uri_targets (impl->browse_files_tree_view);
   
-  g_signal_connect (impl->browse_files_tree_view, "row_activated",
+  g_signal_connect (impl->browse_files_tree_view, "row-activated",
                    G_CALLBACK (list_row_activated), impl);
-  g_signal_connect (impl->browse_files_tree_view, "key_press_event",
+  g_signal_connect (impl->browse_files_tree_view, "key-press-event",
                    G_CALLBACK (trap_activate_cb), impl);
-  g_signal_connect (impl->browse_files_tree_view, "popup_menu",
+  g_signal_connect (impl->browse_files_tree_view, "popup-menu",
                    G_CALLBACK (list_popup_menu_cb), impl);
-  g_signal_connect (impl->browse_files_tree_view, "button_press_event",
+  g_signal_connect (impl->browse_files_tree_view, "button-press-event",
                    G_CALLBACK (list_button_press_event_cb), impl);
 
-  g_signal_connect (impl->browse_files_tree_view, "drag_data_received",
+  g_signal_connect (impl->browse_files_tree_view, "drag-data-received",
                     G_CALLBACK (file_list_drag_data_received_cb), impl);
-  g_signal_connect (impl->browse_files_tree_view, "drag_drop",
+  g_signal_connect (impl->browse_files_tree_view, "drag-drop",
                     G_CALLBACK (file_list_drag_drop_cb), impl);
-  g_signal_connect (impl->browse_files_tree_view, "drag_motion",
+  g_signal_connect (impl->browse_files_tree_view, "drag-motion",
                     G_CALLBACK (file_list_drag_motion_cb), impl);
 
   g_object_set (impl->browse_files_tree_view, "has-tooltip", TRUE, NULL);
@@ -4573,9 +4610,9 @@ create_file_list (GtkFileChooserDefault *impl)
                                          impl, NULL);
   gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (impl->browse_files_tree_view),
                                          GDK_BUTTON1_MASK,
-                                         file_list_source_targets,
-                                         num_file_list_source_targets,
+                                         NULL, 0,
                                          GDK_ACTION_COPY | GDK_ACTION_MOVE);
+  gtk_drag_source_add_uri_targets (impl->browse_files_tree_view);
 
   g_signal_connect (selection, "changed",
                    G_CALLBACK (list_selection_changed), impl);
@@ -4599,14 +4636,14 @@ create_file_list (GtkFileChooserDefault *impl)
                NULL);
   g_signal_connect (impl->list_name_renderer, "edited",
                    G_CALLBACK (renderer_edited_cb), impl);
-  g_signal_connect (impl->list_name_renderer, "editing_canceled",
+  g_signal_connect (impl->list_name_renderer, "editing-canceled",
                    G_CALLBACK (renderer_editing_canceled_cb), impl);
   gtk_tree_view_column_pack_start (impl->list_name_column, impl->list_name_renderer, TRUE);
   gtk_tree_view_column_set_cell_data_func (impl->list_name_column, impl->list_name_renderer,
                                           list_name_data_func, impl, NULL);
 
   gtk_tree_view_append_column (GTK_TREE_VIEW (impl->browse_files_tree_view), impl->list_name_column);
-#if 0
+
   /* Size column */
 
   column = gtk_tree_view_column_new ();
@@ -4618,7 +4655,7 @@ create_file_list (GtkFileChooserDefault *impl)
                                           list_size_data_func, impl, NULL);
   gtk_tree_view_column_set_sort_column_id (column, FILE_LIST_COL_SIZE);
   gtk_tree_view_append_column (GTK_TREE_VIEW (impl->browse_files_tree_view), column);
-#endif
+  impl->list_size_column = column;
 
   /* Modification time column */
 
@@ -5241,9 +5278,6 @@ gtk_file_chooser_default_constructor (GType                  type,
 
   gtk_widget_push_composite_child ();
 
-  /* Recent files manager */
-  recent_manager_update (impl);
-
   /* Shortcuts model */
   shortcuts_model_create (impl);
 
@@ -5319,7 +5353,7 @@ set_local_only (GtkFileChooserDefault *impl,
 
          home_file = g_file_new_for_path (home);
 
-         _gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (impl), home_file, NULL);
+         gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (impl), home_file, NULL);
 
          g_object_unref (home_file);
        }
@@ -5368,7 +5402,7 @@ set_file_system_backend (GtkFileChooserDefault *impl)
 {
   profile_start ("start for backend", "default");
 
-  impl->file_system = gtk_file_system_new ();
+  impl->file_system = _gtk_file_system_new ();
 
   g_signal_connect (impl->file_system, "volumes-changed",
                    G_CALLBACK (volumes_bookmarks_changed_cb), impl);
@@ -5378,6 +5412,17 @@ set_file_system_backend (GtkFileChooserDefault *impl)
   profile_end ("end", NULL);
 }
 
+static void
+unset_file_system_backend (GtkFileChooserDefault *impl)
+{
+  g_signal_handlers_disconnect_by_func (impl->file_system,
+                                       G_CALLBACK (volumes_bookmarks_changed_cb), impl);
+
+  g_object_unref (impl->file_system);
+
+  impl->file_system = NULL;
+}
+
 /* This function is basically a do_all function.
  *
  * It sets the visibility on all the widgets based on the current state, and
@@ -5445,7 +5490,7 @@ update_appearance (GtkFileChooserDefault *impl)
    */
   gtk_widget_queue_draw (impl->browse_files_tree_view);
 
-  g_signal_emit_by_name (impl, "default-size-changed");
+  emit_default_size_changed (impl);
 }
 
 static void
@@ -5761,7 +5806,8 @@ gtk_file_chooser_default_hierarchy_changed (GtkWidget *widget,
   if (previous_toplevel)
     {
       g_assert (impl->toplevel_set_focus_id != 0);
-      g_signal_handler_disconnect (previous_toplevel, impl->toplevel_set_focus_id);
+      g_signal_handler_disconnect (previous_toplevel,
+                                   impl->toplevel_set_focus_id);
       impl->toplevel_set_focus_id = 0;
       impl->toplevel_last_focus_widget = NULL;
     }
@@ -5771,7 +5817,7 @@ gtk_file_chooser_default_hierarchy_changed (GtkWidget *widget,
   toplevel = gtk_widget_get_toplevel (widget);
   if (GTK_IS_WINDOW (toplevel))
     {
-      impl->toplevel_set_focus_id = g_signal_connect (toplevel, "set_focus",
+      impl->toplevel_set_focus_id = g_signal_connect (toplevel, "set-focus",
                                                      G_CALLBACK (toplevel_set_focus_cb), impl);
       impl->toplevel_last_focus_widget = gtk_window_get_focus (GTK_WINDOW (toplevel));
     }
@@ -5846,24 +5892,6 @@ check_icon_theme (GtkFileChooserDefault *impl)
   profile_end ("end", NULL);
 }
 
-static void
-recent_manager_update (GtkFileChooserDefault *impl)
-{
-  GtkRecentManager *manager;
-
-  profile_start ("start", NULL);
-
-  if (gtk_widget_has_screen (GTK_WIDGET (impl)))
-    manager = gtk_recent_manager_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
-  else
-    manager = gtk_recent_manager_get_default ();
-
-  if (impl->recent_manager != manager)
-    impl->recent_manager = manager;
-
-  profile_end ("end", NULL);
-}
-
 static void
 gtk_file_chooser_default_style_set (GtkWidget *widget,
                                    GtkStyle  *previous_style)
@@ -5875,16 +5903,13 @@ gtk_file_chooser_default_style_set (GtkWidget *widget,
   impl = GTK_FILE_CHOOSER_DEFAULT (widget);
 
   profile_msg ("    parent class style_set start", NULL);
-  if (GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->style_set)
-    GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->style_set (widget, previous_style);
+  GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->style_set (widget, previous_style);
   profile_msg ("    parent class style_set end", NULL);
 
   if (gtk_widget_has_screen (GTK_WIDGET (impl)))
     change_icon_theme (impl);
 
-  profile_msg ("    emit default-size-changed start", NULL);
-  g_signal_emit_by_name (widget, "default-size-changed");
-  profile_msg ("    emit default-size-changed end", NULL);
+  emit_default_size_changed (impl);
 
   profile_end ("end", NULL);
 }
@@ -5904,9 +5929,8 @@ gtk_file_chooser_default_screen_changed (GtkWidget *widget,
 
   remove_settings_signal (impl, previous_screen);
   check_icon_theme (impl);
-  recent_manager_update (impl);
 
-  g_signal_emit_by_name (widget, "default-size-changed");
+  emit_default_size_changed (impl);
 
   profile_end ("end", NULL);
 }
@@ -5920,18 +5944,6 @@ gtk_file_chooser_default_size_allocate (GtkWidget     *widget,
   impl = GTK_FILE_CHOOSER_DEFAULT (widget);
 
   GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->size_allocate (widget, allocation);
-
-  impl->default_width = allocation->width;
-  impl->default_height = allocation->height;
-
-  if (impl->preview_widget_active &&
-      impl->preview_widget &&
-      GTK_WIDGET_DRAWABLE (impl->preview_widget))
-    impl->default_width -= impl->preview_widget->allocation.width + PREVIEW_HBOX_SPACING;
-
-  if (impl->extra_widget &&
-      GTK_WIDGET_DRAWABLE (impl->extra_widget))
-    impl->default_height -= GTK_BOX (widget)->spacing + impl->extra_widget->allocation.height;
 }
 
 static gboolean
@@ -5951,7 +5963,7 @@ get_is_file_filtered (GtkFileChooserDefault *impl,
   needed = gtk_file_filter_get_needed (impl->current_filter);
 
   filter_info.display_name = g_file_info_get_display_name (file_info);
-  filter_info.mime_type = g_file_info_get_content_type (file_info);
+  filter_info.mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (file_info));
 
   if (needed & GTK_FILE_FILTER_FILENAME)
     {
@@ -5973,10 +5985,9 @@ get_is_file_filtered (GtkFileChooserDefault *impl,
 
   result = gtk_file_filter_filter (impl->current_filter, &filter_info);
 
-  if (filter_info.filename)
-    g_free ((gchar *)filter_info.filename);
-  if (filter_info.uri)
-    g_free ((gchar *)filter_info.uri);
+  g_free ((gchar *)filter_info.filename);
+  g_free ((gchar *)filter_info.uri);
+  g_free ((gchar *)filter_info.mime_type);
 
   return !result;
 }
@@ -5988,20 +5999,28 @@ settings_load (GtkFileChooserDefault *impl)
   LocationMode location_mode;
   gboolean show_hidden;
   gboolean expand_folders;
+  gboolean show_size_column;
 
   settings = _gtk_file_chooser_settings_new ();
 
   location_mode = _gtk_file_chooser_settings_get_location_mode (settings);
   show_hidden = _gtk_file_chooser_settings_get_show_hidden (settings);
   expand_folders = _gtk_file_chooser_settings_get_expand_folders (settings);
+  show_size_column = _gtk_file_chooser_settings_get_show_size_column (settings);
 
   g_object_unref (settings);
 
   location_mode_set (impl, location_mode, TRUE);
+
   gtk_file_chooser_set_show_hidden (GTK_FILE_CHOOSER (impl), show_hidden);
+
   impl->expand_folders = expand_folders;
   if (impl->save_expander)
     gtk_expander_set_expanded (GTK_EXPANDER (impl->save_expander), expand_folders);
+
+  impl->show_size_column = show_size_column;
+  if (impl->list_size_column)
+    gtk_tree_view_column_set_visible (impl->list_size_column, show_size_column);
 }
 
 static void
@@ -6014,6 +6033,7 @@ settings_save (GtkFileChooserDefault *impl)
   _gtk_file_chooser_settings_set_location_mode (settings, impl->location_mode);
   _gtk_file_chooser_settings_set_show_hidden (settings, gtk_file_chooser_get_show_hidden (GTK_FILE_CHOOSER (impl)));
   _gtk_file_chooser_settings_set_expand_folders (settings, impl->expand_folders);
+  _gtk_file_chooser_settings_set_show_size_column (settings, impl->show_size_column);
 
   /* NULL GError */
   _gtk_file_chooser_settings_save (settings, NULL);
@@ -6074,6 +6094,8 @@ gtk_file_chooser_default_map (GtkWidget *widget)
 
   settings_load (impl);
 
+  emit_default_size_changed (impl);
+
   profile_end ("end", NULL);
 }
 
@@ -6270,7 +6292,7 @@ load_set_model (GtkFileChooserDefault *impl)
   impl->list_sort_ascending = TRUE;
   profile_msg ("    gtk_tree_model_sort_new_with_model end", NULL);
 
-  g_signal_connect (impl->sort_model, "sort_column_changed",
+  g_signal_connect (impl->sort_model, "sort-column-changed",
                    G_CALLBACK (list_sort_column_changed_cb), impl);
 
   profile_msg ("    gtk_tree_view_set_model start", NULL);
@@ -6341,12 +6363,19 @@ static void
 browse_files_select_first_row (GtkFileChooserDefault *impl)
 {
   GtkTreePath *path;
+  GtkTreeIter dummy_iter;
+  GtkTreeModel *tree_model;
 
   if (!impl->sort_model)
     return;
 
   path = gtk_tree_path_new_from_indices (0, -1);
-  gtk_tree_view_set_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, FALSE);
+  tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (impl->browse_files_tree_view));
+
+  /* If the list is empty, do nothing. */
+  if (gtk_tree_model_get_iter (tree_model, &dummy_iter, path))
+      gtk_tree_view_set_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, FALSE);
+
   gtk_tree_path_free (path);
 }
 
@@ -6413,7 +6442,7 @@ show_and_select_files_finished_loading (GtkFolder *folder,
 
       file = l->data;
 
-      info = gtk_folder_get_info (folder, file);
+      info = _gtk_folder_get_info (folder, file);
       if (info)
        {
          if (!have_hidden)
@@ -6476,7 +6505,7 @@ show_and_select_files_get_folder_cb (GCancellable *cancellable,
 
   g_object_unref (cancellable);
 
-  if (gtk_folder_is_finished_loading (folder))
+  if (_gtk_folder_is_finished_loading (folder))
     show_and_select_files_finished_loading (folder, user_data);
   else
     g_signal_connect (folder, "finished-loading",
@@ -6519,9 +6548,9 @@ show_and_select_files (GtkFileChooserDefault *impl,
     g_cancellable_cancel (impl->show_and_select_files_cancellable);
 
   impl->show_and_select_files_cancellable =
-    gtk_file_system_get_folder (impl->file_system, parent_file,
-                               "standard::is-hidden,standard::type,standard::name",
-                               show_and_select_files_get_folder_cb, info);
+    _gtk_file_system_get_folder (impl->file_system, parent_file,
+                                "standard::is-hidden,standard::type,standard::name,standard::content-type",
+                                show_and_select_files_get_folder_cb, info);
 
   profile_end ("end", NULL);
   return TRUE;
@@ -6751,13 +6780,14 @@ update_chooser_entry (GtkFileChooserDefault *impl)
             g_strdup (g_file_info_get_display_name (info));
 
           if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
-              impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
+              impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
+             impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
            {
              /* We don't want the name to change when clicking on a folder... */
              change_entry = (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY);
            }
           else
-           change_entry = TRUE;                                /* ... unless we are in one of the folder modes */
+           change_entry = TRUE; /* ... unless we are in SELECT_FOLDER mode */
 
           if (change_entry)
             {
@@ -6786,7 +6816,8 @@ update_chooser_entry (GtkFileChooserDefault *impl)
 
  maybe_clear_entry:
 
-  if (impl->browse_files_last_selected_name)
+  if ((impl->action == GTK_FILE_CHOOSER_ACTION_OPEN || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+      && impl->browse_files_last_selected_name)
     {
       const char *entry_text;
       int len;
@@ -6882,10 +6913,10 @@ update_current_folder_get_info_cb (GCancellable *cancellable,
          impl->reload_state = RELOAD_HAS_FOLDER;
 
          impl->update_current_folder_cancellable =
-           gtk_file_system_get_info (impl->file_system, data->file,
-                                     "standard::type",
-                                     update_current_folder_get_info_cb,
-                                     data);
+           _gtk_file_system_get_info (impl->file_system, data->file,
+                                      "standard::type",
+                                      update_current_folder_get_info_cb,
+                                      data);
 
          set_busy_cursor (impl, TRUE);
 
@@ -6982,6 +7013,8 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser    *chooser,
 
   profile_start ("start", NULL);
 
+  g_object_ref (file);
+
   switch (impl->operation_mode)
     {
     case OPERATION_MODE_SEARCH:
@@ -6996,11 +7029,12 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser    *chooser,
 
   if (impl->local_only && !g_file_is_native (file))
     {
-      g_set_error (error,
-                  GTK_FILE_CHOOSER_ERROR,
-                  GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
-                  _("Cannot change to folder because it is not local"));
+      g_set_error_literal (error,
+                           GTK_FILE_CHOOSER_ERROR,
+                           GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
+                           _("Cannot change to folder because it is not local"));
 
+      g_object_unref (file);
       profile_end ("end - not local", NULL);
       return FALSE;
     }
@@ -7018,12 +7052,13 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser    *chooser,
   impl->reload_state = RELOAD_HAS_FOLDER;
 
   impl->update_current_folder_cancellable =
-    gtk_file_system_get_info (impl->file_system, file,
-                             "standard::type",
-                             update_current_folder_get_info_cb,
-                             data);
+    _gtk_file_system_get_info (impl->file_system, file,
+                              "standard::type",
+                              update_current_folder_get_info_cb,
+                              data);
 
   set_busy_cursor (impl, TRUE);
+  g_object_unref (file);
 
   profile_end ("end", NULL);
   return TRUE;
@@ -7053,7 +7088,10 @@ gtk_file_chooser_default_get_current_folder (GtkFileChooser *chooser)
       return file;
     }
 
-  return g_object_ref (impl->current_folder);
+  if (impl->current_folder)
+    return g_object_ref (impl->current_folder);
+
+  return NULL;
 }
 
 static void
@@ -7097,7 +7135,7 @@ gtk_file_chooser_default_select_file (GtkFileChooser  *chooser,
   parent_file = g_file_get_parent (file);
 
   if (!parent_file)
-    return _gtk_file_chooser_set_current_folder_file (chooser, file, error);
+    return gtk_file_chooser_set_current_folder_file (chooser, file, error);
 
   if (impl->operation_mode == OPERATION_MODE_SEARCH ||
       impl->operation_mode == OPERATION_MODE_RECENT ||
@@ -7131,7 +7169,7 @@ gtk_file_chooser_default_select_file (GtkFileChooser  *chooser,
     {
       gboolean result;
 
-      result = _gtk_file_chooser_set_current_folder_file (chooser, parent_file, error);
+      result = gtk_file_chooser_set_current_folder_file (chooser, parent_file, error);
       g_object_unref (parent_file);
       return result;
     }
@@ -7436,13 +7474,18 @@ gtk_file_chooser_default_get_files (GtkFileChooser *chooser)
   if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER &&
       info.result == NULL)
     {
-      info.result = g_slist_prepend (info.result, _gtk_file_chooser_get_current_folder_file (chooser));
+      GFile *current_folder;
+
+      current_folder = gtk_file_chooser_get_current_folder_file (chooser);
+
+      if (current_folder)
+        info.result = g_slist_prepend (info.result, current_folder);
     }
 
   return g_slist_reverse (info.result);
 }
 
-static GFile *
+GFile *
 gtk_file_chooser_default_get_preview_file (GtkFileChooser *chooser)
 {
   GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
@@ -7647,9 +7690,9 @@ gtk_file_chooser_default_add_shortcut_folder (GtkFileChooser  *chooser,
   data->impl = g_object_ref (impl);
   data->file = g_object_ref (file);
 
-  cancellable = gtk_file_system_get_info (impl->file_system, file,
-                                         "standard::type",
-                                         add_shortcut_get_info_cb, data);
+  cancellable = _gtk_file_system_get_info (impl->file_system, file,
+                                          "standard::type",
+                                          add_shortcut_get_info_cb, data);
 
   if (!cancellable)
     return FALSE;
@@ -7790,28 +7833,21 @@ find_good_size_from_style (GtkWidget *widget,
   g_assert (widget->style != NULL);
   impl = GTK_FILE_CHOOSER_DEFAULT (widget);
 
-  if (impl->default_width == 0 &&
-      impl->default_height == 0)
+  screen = gtk_widget_get_screen (widget);
+  if (screen)
     {
-      screen = gtk_widget_get_screen (widget);
-      if (screen)
-       {
-         resolution = gdk_screen_get_resolution (screen);
-         if (resolution < 0.0) /* will be -1 if the resolution is not defined in the GdkScreen */
-           resolution = 96.0;
-       }
-      else
-       resolution = 96.0; /* wheeee */
-
-      font_size = pango_font_description_get_size (widget->style->font_desc);
-      font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
-
-      impl->default_width = font_size * NUM_CHARS;
-      impl->default_height = font_size * NUM_LINES;
+      resolution = gdk_screen_get_resolution (screen);
+      if (resolution < 0.0) /* will be -1 if the resolution is not defined in the GdkScreen */
+       resolution = 96.0;
     }
+  else
+    resolution = 96.0; /* wheeee */
 
-  *width = impl->default_width;
-  *height = impl->default_height;
+  font_size = pango_font_description_get_size (widget->style->font_desc);
+  font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
+
+  *width = font_size * NUM_CHARS;
+  *height = font_size * NUM_LINES;
 }
 
 static void
@@ -7823,21 +7859,33 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
   GtkRequisition req;
 
   impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
-  find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
 
-  if (impl->preview_widget_active &&
-      impl->preview_widget &&
-      GTK_WIDGET_VISIBLE (impl->preview_widget))
+  if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
+      || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
+      || impl->expand_folders)
     {
-      gtk_widget_size_request (impl->preview_box, &req);
-      *default_width += PREVIEW_HBOX_SPACING + req.width;
-    }
+      find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
 
-  if (impl->extra_widget &&
-      GTK_WIDGET_VISIBLE (impl->extra_widget))
+      if (impl->preview_widget_active &&
+         impl->preview_widget &&
+         GTK_WIDGET_VISIBLE (impl->preview_widget))
+       {
+         gtk_widget_size_request (impl->preview_box, &req);
+         *default_width += PREVIEW_HBOX_SPACING + req.width;
+       }
+
+      if (impl->extra_widget &&
+         GTK_WIDGET_VISIBLE (impl->extra_widget))
+       {
+         gtk_widget_size_request (impl->extra_align, &req);
+         *default_height += GTK_BOX (chooser_embed)->spacing + req.height;
+       }
+    }
+  else
     {
-      gtk_widget_size_request (impl->extra_align, &req);
-      *default_height += GTK_BOX (chooser_embed)->spacing + req.height;
+      gtk_widget_size_request (GTK_WIDGET (impl), &req);
+      *default_width = req.width;
+      *default_height = req.height;
     }
 }
 
@@ -8069,10 +8117,10 @@ should_respond_after_confirm_overwrite (GtkFileChooserDefault *impl,
          g_cancellable_cancel (impl->should_respond_get_info_cancellable);
 
        impl->should_respond_get_info_cancellable =
-         gtk_file_system_get_info (impl->file_system, parent_file,
-                                   "standard::display-name",
-                                   confirmation_confirm_get_info_cb,
-                                   data);
+         _gtk_file_system_get_info (impl->file_system, parent_file,
+                                    "standard::display-name",
+                                    confirmation_confirm_get_info_cb,
+                                    data);
        set_busy_cursor (data->impl, TRUE);
        return FALSE;
       }
@@ -8215,11 +8263,11 @@ file_exists_get_info_cb (GCancellable *cancellable,
        g_cancellable_cancel (data->impl->should_respond_get_info_cancellable);
 
       data->impl->should_respond_get_info_cancellable =
-       gtk_file_system_get_info (data->impl->file_system,
-                                 data->parent_file,
-                                 "standard::type",
-                                 save_entry_get_info_cb,
-                                 data);
+       _gtk_file_system_get_info (data->impl->file_system,
+                                  data->parent_file,
+                                  "standard::type",
+                                  save_entry_get_info_cb,
+                                  data);
       set_busy_cursor (data->impl, TRUE);
     }
 
@@ -8425,10 +8473,10 @@ gtk_file_chooser_default_should_respond (GtkFileChooserEmbed *chooser_embed)
            g_cancellable_cancel (impl->file_exists_get_info_cancellable);
 
          impl->file_exists_get_info_cancellable =
-           gtk_file_system_get_info (impl->file_system, file,
-                                     "standard::type",
-                                     file_exists_get_info_cb,
-                                     data);
+           _gtk_file_system_get_info (impl->file_system, file,
+                                      "standard::type",
+                                      file_exists_get_info_cb,
+                                      data);
 
          set_busy_cursor (impl, TRUE);
          retval = FALSE;
@@ -8514,7 +8562,7 @@ search_selected_foreach_get_file_cb (GtkTreeModel *model,
   list = data;
 
   gtk_tree_model_get (model, iter, SEARCH_MODEL_COL_FILE, &file, -1);
-  *list = g_slist_prepend (*list, file);
+  *list = g_slist_prepend (*list, g_object_ref (file));
 }
 
 /* Constructs a list of the selected paths in search mode */
@@ -8566,6 +8614,9 @@ search_hit_get_info_cb (GCancellable *cancellable,
   GtkTreeIter iter;
   GCancellable *model_cancellable;
   gboolean is_folder = FALSE;
+  GTimeVal mtime;
+  guint64 modification_time = 0;
+  goffset size;
   char *mime_type;
   char *display_name;
   struct SearchHitInsertRequest *request = data;
@@ -8597,21 +8648,27 @@ search_hit_get_info_cb (GCancellable *cancellable,
 
   if (!info)
     {
+      search_clear_model_row (GTK_TREE_MODEL (request->impl->search_model), &iter);
       gtk_list_store_remove (request->impl->search_model, &iter);
       goto out;
     }
 
   display_name = g_strdup (g_file_info_get_display_name (info));
-  mime_type = g_strdup (g_file_info_get_content_type (info));
+  mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (info));
+  g_file_info_get_modification_time (info, &mtime);
+  modification_time = (guint64) mtime.tv_sec;
+  size = g_file_info_get_size (info);
   is_folder = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY);
-  pixbuf = gtk_file_info_render_icon (info, GTK_WIDGET (request->impl),
-                                     request->impl->icon_size);
+  pixbuf = _gtk_file_info_render_icon (info, GTK_WIDGET (request->impl),
+                                      request->impl->icon_size);
 
   gtk_list_store_set (request->impl->search_model, &iter,
                       SEARCH_MODEL_COL_PIXBUF, pixbuf,
                       SEARCH_MODEL_COL_DISPLAY_NAME, display_name,
                       SEARCH_MODEL_COL_MIME_TYPE, mime_type,
                       SEARCH_MODEL_COL_IS_FOLDER, is_folder,
+                      SEARCH_MODEL_COL_MTIME, modification_time,
+                      SEARCH_MODEL_COL_SIZE, size,
                       -1);
 
   if (pixbuf)
@@ -8632,17 +8689,16 @@ search_add_hit (GtkFileChooserDefault *impl,
                gchar                 *uri)
 {
   GFile *file;
-  char *filename;
   char *tmp;
   char *collation_key;
-  struct stat statbuf;
-  struct stat *statbuf_copy;
   GtkTreeIter iter;
   GtkTreePath *p;
   GCancellable *cancellable;
   struct SearchHitInsertRequest *request;
 
   file = g_file_new_for_uri (uri);
+  if (!file)
+    return;
 
   if (!g_file_is_native (file))
     {
@@ -8650,18 +8706,6 @@ search_add_hit (GtkFileChooserDefault *impl,
       return;
     }
 
-  filename = g_file_get_path (file);
-
-  if (stat (filename, &statbuf) != 0)
-    {
-      g_object_unref (file);
-      g_free (filename);
-      return;
-    }
-
-  statbuf_copy = g_new (struct stat, 1);
-  *statbuf_copy = statbuf;
-
   tmp = g_file_get_parse_name (file);
   collation_key = g_utf8_collate_key_for_filename (tmp, -1);
   g_free (tmp);
@@ -8676,21 +8720,21 @@ search_add_hit (GtkFileChooserDefault *impl,
   request->row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (impl->search_model), p);
   gtk_tree_path_free (p);
 
-  cancellable = gtk_file_system_get_info (impl->file_system, file,
-                                         "standard::type,standard::icon,"
-                                         "standard::content-type,standard::display-name",
-                                         search_hit_get_info_cb,
-                                         request);
+  cancellable = _gtk_file_system_get_info (impl->file_system, file,
+                                          "standard::type,"
+                                           "standard::icon,"
+                                          "standard::content-type,"
+                                           "standard::display-name,"
+                                           "time::modified,"
+                                           "standard::size",
+                                          search_hit_get_info_cb,
+                                          request);
 
   gtk_list_store_set (impl->search_model, &iter,
                       SEARCH_MODEL_COL_FILE, file,
                       SEARCH_MODEL_COL_COLLATION_KEY, collation_key,
-                      SEARCH_MODEL_COL_STAT, statbuf_copy,
                       SEARCH_MODEL_COL_CANCELLABLE, cancellable,
                       -1);
-
-  g_object_unref (file);
-  g_free (filename);
 }
 
 /* Callback used from GtkSearchEngine when we get new hits */
@@ -8757,6 +8801,35 @@ search_engine_error_cb (GtkSearchEngine *engine,
   set_busy_cursor (impl, FALSE);
 }
 
+static void
+search_clear_model_row (GtkTreeModel *model,
+                        GtkTreeIter  *iter)
+{
+  GFile *file;
+  gchar *display_name;
+  gchar *collation_key;
+  GCancellable *cancellable;
+  gchar *mime_type;
+
+  gtk_tree_model_get (model, iter,
+                      SEARCH_MODEL_COL_FILE, &file,
+                      SEARCH_MODEL_COL_DISPLAY_NAME, &display_name,
+                      SEARCH_MODEL_COL_COLLATION_KEY, &collation_key,
+                      SEARCH_MODEL_COL_CANCELLABLE, &cancellable,
+                      SEARCH_MODEL_COL_MIME_TYPE, &mime_type,
+                      -1);
+
+  if (file)
+    g_object_unref (file);
+
+  g_free (display_name);
+  g_free (collation_key);
+  g_free (mime_type);
+           
+  if (cancellable)
+    g_cancellable_cancel (cancellable);
+}
+
 /* Frees the data in the search_model */
 static void
 search_clear_model (GtkFileChooserDefault *impl, 
@@ -8773,14 +8846,7 @@ search_clear_model (GtkFileChooserDefault *impl,
   if (gtk_tree_model_get_iter_first (model, &iter))
     do
       {
-       GCancellable *cancellable;
-
-       gtk_tree_model_get (model, &iter,
-                            SEARCH_MODEL_COL_CANCELLABLE, &cancellable,
-                           -1);
-
-        if (cancellable)
-         g_cancellable_cancel (cancellable);
+        search_clear_model_row (model, &iter);
       }
     while (gtk_tree_model_iter_next (model, &iter));
 
@@ -8884,6 +8950,41 @@ search_column_path_sort_func (GtkTreeModel *model,
   return strcmp (collation_key_a, collation_key_b);
 }
 
+/* Sort callback from the size column */
+static gint
+search_column_size_sort_func (GtkTreeModel *model,
+                              GtkTreeIter  *a,
+                              GtkTreeIter  *b,
+                              gpointer      user_data)
+{
+  GtkFileChooserDefault *impl = user_data;
+  GtkTreeIter child_a, child_b;
+  gboolean is_folder_a, is_folder_b;
+  goffset size_a, size_b;
+
+  gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_a, a);
+  gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_b, b);
+
+  gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), &child_a,
+                      SEARCH_MODEL_COL_IS_FOLDER, &is_folder_a,
+                      SEARCH_MODEL_COL_SIZE, &size_a,
+                      -1);
+  gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), &child_b,
+                      SEARCH_MODEL_COL_IS_FOLDER, &is_folder_b,
+                      SEARCH_MODEL_COL_SIZE, &size_b,
+                      -1);
+  
+  if (is_folder_a != is_folder_b)
+    return is_folder_a ? 1 : -1;
+
+  if (size_a < size_b)
+    return -1;
+  else if (size_a > size_b)
+    return 1;
+  else
+    return 0;
+}
+
 /* Sort callback from the modification time column */
 static gint
 search_column_mtime_sort_func (GtkTreeModel *model,
@@ -8893,38 +8994,27 @@ search_column_mtime_sort_func (GtkTreeModel *model,
 {
   GtkFileChooserDefault *impl = user_data;
   GtkTreeIter child_a, child_b;
-  const struct stat *statbuf_a, *statbuf_b;
   gboolean is_folder_a, is_folder_b;
+  guint64 mtime_a, mtime_b;
 
   gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_a, a);
   gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_b, b);
 
-  /* Note that although we store a whole struct stat in the model, we only
-   * compare the mtime here.  If we add another column relative to a struct stat
-   * (e.g. a file size column), we'll want another sort callback similar to this
-   * one as well.
-   */
   gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), &child_a,
                       SEARCH_MODEL_COL_IS_FOLDER, &is_folder_a,
-                      SEARCH_MODEL_COL_STAT, &statbuf_a,
+                      SEARCH_MODEL_COL_MTIME, &mtime_a,
                       -1);
   gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), &child_b,
                       SEARCH_MODEL_COL_IS_FOLDER, &is_folder_b,
-                      SEARCH_MODEL_COL_STAT, &statbuf_b,
+                      SEARCH_MODEL_COL_MTIME, &mtime_b,
                       -1);
   
-  if (!statbuf_a)
-    return 1;
-
-  if (!statbuf_b)
-    return -1;
-
   if (is_folder_a != is_folder_b)
     return is_folder_a ? 1 : -1;
 
-  if (statbuf_a->st_mtime < statbuf_b->st_mtime)
+  if (mtime_a < mtime_b)
     return -1;
-  else if (statbuf_a->st_mtime > statbuf_b->st_mtime)
+  else if (mtime_a > mtime_b)
     return 1;
   else
     return 0;
@@ -9024,7 +9114,8 @@ search_setup_model (GtkFileChooserDefault *impl)
    *   as a pointer not as a G_TYPE_STRING
    * SEARCH_MODEL_COL_COLLATION_KEY - collation key for the filename, stored
    *   as a pointer not as a G_TYPE_STRING
-   * SEARCH_MODEL_COL_STAT - pointer to a struct stat
+   * SEARCH_MODEL_COL_MTIME - G_TYPE_UINT64 for the modification time
+   * SEARCH_MODEL_COL_SIZE - G_TYPE_INT64 for the size
    * SEARCH_MODEL_COL_CANCELLABLE - cancellable used when getting the hit's info
    * SEARCH_MODEL_COL_PIXBUF - GdkPixbuf for the hit's icon
    * SEARCH_MODEL_COL_MIME_TYPE - a string with the hit's MIME type
@@ -9034,14 +9125,15 @@ search_setup_model (GtkFileChooserDefault *impl)
    * of this file.
    */
   impl->search_model = gtk_list_store_new (SEARCH_MODEL_COL_NUM_COLUMNS,
-                                          G_TYPE_POINTER,
-                                          G_TYPE_POINTER,
-                                          G_TYPE_POINTER,
-                                          G_TYPE_POINTER,
-                                           G_TYPE_POINTER,
-                                           GDK_TYPE_PIXBUF,
-                                           G_TYPE_POINTER,
-                                           G_TYPE_BOOLEAN);
+                                          G_TYPE_POINTER, /* file */
+                                          G_TYPE_POINTER, /* display-name */
+                                          G_TYPE_POINTER, /* collation-key */
+                                          G_TYPE_UINT64, /* mtime */
+                                           G_TYPE_INT64, /* size */
+                                           G_TYPE_POINTER, /* cancellable */
+                                           GDK_TYPE_PIXBUF, /* pixbuf */
+                                           G_TYPE_POINTER, /* mime-type */
+                                           G_TYPE_BOOLEAN /*is-folder */);
   
   impl->search_model_filter =
     GTK_TREE_MODEL_FILTER (gtk_tree_model_filter_new (GTK_TREE_MODEL (impl->search_model), NULL));
@@ -9056,11 +9148,15 @@ search_setup_model (GtkFileChooserDefault *impl)
                                   search_column_path_sort_func,
                                   impl, NULL);
   gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (impl->search_model_sort),
-                                  SEARCH_MODEL_COL_STAT,
+                                  SEARCH_MODEL_COL_MTIME,
                                   search_column_mtime_sort_func,
                                   impl, NULL);
+  gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (impl->search_model_sort),
+                                  SEARCH_MODEL_COL_SIZE,
+                                  search_column_size_sort_func,
+                                  impl, NULL);
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (impl->search_model_sort),
-                                       SEARCH_MODEL_COL_STAT,
+                                       SEARCH_MODEL_COL_MTIME,
                                        GTK_SORT_DESCENDING);
 
   /* EB: setting the model here will make the hits list update feel
@@ -9353,6 +9449,8 @@ recent_switch_to_browse_mode (GtkFileChooserDefault *impl)
        gtk_widget_show (impl->location_entry_box);
     }
 
+  gtk_tree_view_column_set_visible (impl->list_size_column, impl->show_size_column);
+
   impl->operation_mode = OPERATION_MODE_BROWSE;
 
   file_list_set_sort_column_ids (impl);
@@ -9768,10 +9866,10 @@ recent_idle_load (gpointer data)
   request->row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (impl->recent_model), p);
   gtk_tree_path_free (p);
 
-  cancellable = gtk_file_system_get_info (impl->file_system, file,
-                                         "standard::type",
-                                         recent_item_get_info_cb,
-                                         request);
+  cancellable = _gtk_file_system_get_info (impl->file_system, file,
+                                          "standard::type",
+                                          recent_item_get_info_cb,
+                                          request);
 
   gtk_list_store_set (impl->recent_model, &iter,
                       RECENT_MODEL_COL_FILE, file,
@@ -9805,9 +9903,6 @@ recent_start_loading (GtkFileChooserDefault *impl)
   recent_setup_model (impl);
   set_busy_cursor (impl, TRUE);
 
-  if (!impl->recent_manager)
-    recent_manager_update (impl);
-
   g_assert (impl->load_recent_id == 0);
 
   load_data = g_new (RecentLoadData, 1);
@@ -9919,6 +10014,10 @@ recent_activate (GtkFileChooserDefault *impl)
     }
 
   recent_hide_entry (impl);
+
+  /* hide the file size column if it's visible */
+  gtk_tree_view_column_set_visible (impl->list_size_column, FALSE);
+
   file_list_set_sort_column_ids (impl);
   recent_start_loading (impl);
 }
@@ -10116,7 +10215,7 @@ shortcuts_activate_volume_mount_cb (GCancellable        *cancellable,
         {
           char *msg, *name;
 
-         name = gtk_file_system_volume_get_display_name (volume);
+         name = _gtk_file_system_volume_get_display_name (volume);
           msg = g_strdup_printf (_("Could not mount %s"), name);
 
           error_message (impl, msg, error->message);
@@ -10128,7 +10227,7 @@ shortcuts_activate_volume_mount_cb (GCancellable        *cancellable,
       goto out;
     }
 
-  file = gtk_file_system_volume_get_root (volume);
+  file = _gtk_file_system_volume_get_root (volume);
   if (file != NULL)
     {
       change_folder_and_display_error (impl, file, FALSE);
@@ -10167,18 +10266,22 @@ shortcuts_activate_volume (GtkFileChooserDefault *impl,
    */
   g_object_ref (impl);
 
-  if (!gtk_file_system_volume_is_mounted (volume))
+  if (!_gtk_file_system_volume_is_mounted (volume))
     {
-      set_busy_cursor (impl, TRUE);
+      GtkMountOperation *mount_op;
 
+      set_busy_cursor (impl, TRUE);
+   
+      mount_op = gtk_mount_operation_new (get_toplevel (GTK_WIDGET (impl)));
       impl->shortcuts_activate_iter_cancellable =
-        gtk_file_system_mount_volume (impl->file_system, volume, NULL,
-                                     shortcuts_activate_volume_mount_cb,
-                                     g_object_ref (impl));
+        _gtk_file_system_mount_volume (impl->file_system, volume, mount_op,
+                                      shortcuts_activate_volume_mount_cb,
+                                      g_object_ref (impl));
+      g_object_unref (mount_op);
     }
   else
     {
-      file = gtk_file_system_volume_get_root (volume);
+      file = _gtk_file_system_volume_get_root (volume);
       if (file != NULL)
         {
           change_folder_and_display_error (impl, file, FALSE);
@@ -10248,9 +10351,9 @@ shortcuts_activate_mount_enclosing_volume (GCancellable        *cancellable,
     }
 
   data->impl->shortcuts_activate_iter_cancellable =
-    gtk_file_system_get_info (data->impl->file_system, data->file,
-                             "standard::type",
-                             shortcuts_activate_get_info_cb, data);
+    _gtk_file_system_get_info (data->impl->file_system, data->file,
+                              "standard::type",
+                              shortcuts_activate_get_info_cb, data);
 }
 
 static void
@@ -10260,7 +10363,9 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
   gpointer col_data;
   ShortcutType shortcut_type;
 
-  if (impl->location_mode == LOCATION_MODE_FILENAME_ENTRY && impl->action != GTK_FILE_CHOOSER_ACTION_SAVE)
+  if (impl->location_mode == LOCATION_MODE_FILENAME_ENTRY
+      && !(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
+          || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
     _gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), "");
 
   gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), iter,
@@ -10289,13 +10394,13 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
       struct ShortcutsActivateData *data;
       GtkFileSystemVolume *volume;
 
-      volume = gtk_file_system_get_volume_for_file (impl->file_system, col_data);
+      volume = _gtk_file_system_get_volume_for_file (impl->file_system, col_data);
 
       data = g_new0 (struct ShortcutsActivateData, 1);
       data->impl = g_object_ref (impl);
       data->file = g_object_ref (col_data);
 
-      if (!volume || !gtk_file_system_volume_is_mounted (volume))
+      if (!volume || !_gtk_file_system_volume_is_mounted (volume))
        {
          GMountOperation *mount_operation;
          GtkWidget *toplevel;
@@ -10305,17 +10410,17 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
          mount_operation = gtk_mount_operation_new (GTK_WINDOW (toplevel));
 
          impl->shortcuts_activate_iter_cancellable =
-           gtk_file_system_mount_enclosing_volume (impl->file_system, col_data,
-                                                   mount_operation,
-                                                   shortcuts_activate_mount_enclosing_volume,
-                                                   data);
+           _gtk_file_system_mount_enclosing_volume (impl->file_system, col_data,
+                                                    mount_operation,
+                                                    shortcuts_activate_mount_enclosing_volume,
+                                                    data);
        }
       else
        {
          impl->shortcuts_activate_iter_cancellable =
-           gtk_file_system_get_info (impl->file_system, data->file,
-                                     "standard::type",
-                                     shortcuts_activate_get_info_cb, data);
+           _gtk_file_system_get_info (impl->file_system, data->file,
+                                      "standard::type",
+                                      shortcuts_activate_get_info_cb, data);
        }
     }
   else if (shortcut_type == SHORTCUT_TYPE_SEARCH)
@@ -10665,7 +10770,7 @@ list_icon_data_func (GtkTreeViewColumn *tree_column,
             if (info)
               {
                 /* FIXME: NULL GError */
-               pixbuf = gtk_file_info_render_icon (info, GTK_WIDGET (impl), impl->icon_size);
+               pixbuf = _gtk_file_info_render_icon (info, GTK_WIDGET (impl), impl->icon_size);
              }
           }
         else
@@ -10791,7 +10896,6 @@ list_name_data_func (GtkTreeViewColumn *tree_column,
                NULL);
 }
 
-#if 0
 static void
 list_size_data_func (GtkTreeViewColumn *tree_column,
                     GtkCellRenderer   *cell,
@@ -10800,11 +10904,46 @@ list_size_data_func (GtkTreeViewColumn *tree_column,
                     gpointer           data)
 {
   GtkFileChooserDefault *impl = data;
-  GFileInfo *info = get_list_file_info (impl, iter);
-  gint64 size;
+  GFileInfo *info;
+  goffset size;
   gchar *str;
   gboolean sensitive = TRUE;
 
+  if (impl->operation_mode == OPERATION_MODE_RECENT)
+    return;
+
+  if (impl->operation_mode == OPERATION_MODE_SEARCH)
+    {
+      GtkTreeIter child_iter;
+      gboolean is_folder = FALSE;
+
+      search_get_valid_child_iter (impl, &child_iter, iter);
+      gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), &child_iter,
+                          SEARCH_MODEL_COL_SIZE, &size,
+                          SEARCH_MODEL_COL_IS_FOLDER, &is_folder,
+                         -1);
+
+      if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
+          impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+        sensitive = is_folder ? TRUE : FALSE;
+
+      if (!is_folder)
+        str = g_format_size_for_display (size);
+      else
+        str = NULL;
+
+      g_object_set (cell,
+                    "text", str,
+                    "sensitive", sensitive,
+                    NULL);
+
+      g_free (str);
+
+      return;
+    }
+
+  info = get_list_file_info (impl, iter);
+
   if (!info || g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY)
     {
       g_object_set (cell,
@@ -10814,18 +10953,9 @@ list_size_data_func (GtkTreeViewColumn *tree_column,
       return;
     }
 
-  size = gtk_file_info_get_size (info);
-#if 0
-  if (size < (gint64)1024)
-    str = g_strdup_printf (g_dngettext (GETTEXT_DOMAIN, "%d byte", "%d bytes", (gint)size), (gint)size);
-  else if (size < (gint64)1024*1024)
-    str = g_strdup_printf (_("%.1f KB"), size / (1024.));
-  else if (size < (gint64)1024*1024*1024)
-    str = g_strdup_printf (_("%.1f MB"), size / (1024.*1024.));
-  else
-    str = g_strdup_printf (_("%.1f GB"), size / (1024.*1024.*1024.));
-#endif
-  str = g_strdup_printf ("%" G_GINT64_FORMAT, size);
+  size = g_file_info_get_size (info);
+  str = g_format_size_for_display (size);
+
   if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
       impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
     sensitive = FALSE;
@@ -10838,7 +10968,6 @@ list_size_data_func (GtkTreeViewColumn *tree_column,
 
   g_free (str);
 }
-#endif
 
 /* Tree column data callback for the file list; fetches the mtime of a file */
 static void
@@ -10864,19 +10993,16 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
   if (impl->operation_mode == OPERATION_MODE_SEARCH)
     {
       GtkTreeIter child_iter;
-      struct stat *statbuf;
+      guint64 mtime;
       gboolean is_folder;
 
       search_get_valid_child_iter (impl, &child_iter, iter);
       gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), &child_iter,
-                          SEARCH_MODEL_COL_STAT, &statbuf,
+                          SEARCH_MODEL_COL_MTIME, &mtime,
                           SEARCH_MODEL_COL_IS_FOLDER, &is_folder,
                          -1);
-      if (statbuf)
-        time_mtime = statbuf->st_mtime;
-      else
-        time_mtime = 0;
 
+      time_mtime = (time_t) mtime;
 
       if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
           impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
@@ -11032,11 +11158,9 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
 }
 
 GtkWidget *
-_gtk_file_chooser_default_new (const char *file_system)
+_gtk_file_chooser_default_new (void)
 {
-  return  g_object_new (GTK_TYPE_FILE_CHOOSER_DEFAULT,
-                       "file-system-backend", file_system,
-                       NULL);
+  return g_object_new (GTK_TYPE_FILE_CHOOSER_DEFAULT, NULL);
 }
 
 static void