diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2008-12-14 02:14:19 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-12-14 02:14:19 +0000 |
commit | 50329fa7c00938d9aea14751f0367903386a730a (patch) | |
tree | 4ae708a06ba4089266040bfc310848169b105b05 /gtk/gtkfilesystem.c | |
parent | d68d9790df7ded822e318908a4d7c0639c9f7d6f (diff) | |
download | gtk+-50329fa7c00938d9aea14751f0367903386a730a.tar.gz |
Privately export this method. It classifies directories and mountables the
* gtk/gtkfilesystem.[hc] (_gtk_file_info_consider_as_directory):
Privately export this method. It classifies directories and mountables
the same.
* gtk/gtkfilesystem.c (enclosing_volume_mount_cb): Silently drop
G_IO_ERROR_ALREADY_MOUNTED error for gvfs backends without visible
mounts.
* gtk/gtkfilesystemmodel.c:
* gtk/gtkfilechooserbutton.c:
* gtk/gtkfilechooserentry.c:
* gtk/gtkfilechooserdefault.c: Use the new function instead of
direct checks for G_FILE_TYPE_DIRECTORY throughout.
svn path=/trunk/; revision=21898
Diffstat (limited to 'gtk/gtkfilesystem.c')
-rw-r--r-- | gtk/gtkfilesystem.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c index a46f60c620..f4b78d4d54 100644 --- a/gtk/gtkfilesystem.c +++ b/gtk/gtkfilesystem.c @@ -959,6 +959,11 @@ enclosing_volume_mount_cb (GObject *source_object, g_file_mount_enclosing_volume_finish (G_FILE (source_object), result, &error); volume = _gtk_file_system_get_volume_for_file (async_data->file_system, G_FILE (source_object)); + /* Silently drop G_IO_ERROR_ALREADY_MOUNTED error for gvfs backends without visible mounts. */ + /* Better than doing query_info with additional I/O every time. */ + if (error && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_ALREADY_MOUNTED)) + g_clear_error (&error); + gdk_threads_enter (); ((GtkFileSystemVolumeMountCallback) async_data->callback) (async_data->cancellable, volume, error, async_data->data); @@ -1791,3 +1796,13 @@ _gtk_file_info_render_icon (GFileInfo *info, return pixbuf; } + +gboolean +_gtk_file_info_consider_as_directory (GFileInfo *info) +{ + GFileType type = g_file_info_get_file_type (info); + + return (type == G_FILE_TYPE_DIRECTORY || + type == G_FILE_TYPE_MOUNTABLE); +} + |