diff options
author | Jasmine Hassan <[email protected]> | 2012-11-07 01:50:57 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-16 09:45:53 +0200 |
commit | 43dad9d04402b97de8440366d03d43dbe954528a (patch) | |
tree | 0dbe5b0a32246ecf50889e51454c7a7941d5158a /src/file-manager | |
parent | aa6696e05a7c2614eccde660bf06554735ace3e2 (diff) | |
download | caja-43dad9d04402b97de8440366d03d43dbe954528a.tar.bz2 caja-43dad9d04402b97de8440366d03d43dbe954528a.tar.xz |
[icon-view] if possible, use the local path for the preview
This solves issues where the audio previewer is not capable of
understanding some GVfs URIs. (#624841)
http://git.gnome.org/browse/nautilus/commit/?id=ebcbb167876f8b4491af0bc86bc29015c211b3af
Diffstat (limited to 'src/file-manager')
-rw-r--r-- | src/file-manager/fm-icon-view.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index a9fb8b11..931df9f8 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -2192,6 +2192,8 @@ play_file (gpointer callback_data) char **argv; GError *error; char *uri; + GFile *gfile; + char *path; icon_view = FM_ICON_VIEW (callback_data); @@ -2199,7 +2201,21 @@ play_file (gpointer callback_data) icon_view->details->audio_preview_timeout = 0; file = icon_view->details->audio_preview_file; - uri = caja_file_get_uri (file); + gfile = caja_file_get_location (file); + path = g_file_get_path (gfile); + + /* if we have a local path, use that instead of the native URI. + * this can be useful for special GVfs mounts, such as cdda:// + */ + if (path) { + uri = g_filename_to_uri (path, NULL, NULL); + } else { + uri = caja_file_get_uri (file); + } + + g_object_unref (gfile); + g_free (path); + argv = get_preview_argv (uri); g_free (uri); if (argv == NULL) |