summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2013-12-17 07:54:22 +0200
committerRoss Lagerwall <rosslagerwall@gmail.com>2014-04-30 08:29:08 +0100
commitd872d9ca4437c6e24948d8a730dea884c4299783 (patch)
tree48514fade2cd1495b76fb3b474522c50dc98b7ba
parent8ec1666eb2a42dad7e4bafe4545b0d945f4fbc29 (diff)
downloadgvfs-d872d9ca4437c6e24948d8a730dea884c4299783.tar.gz
trash: Implement query_info_on_read()
Implement query_info_on_read() by proxying to the underlying stream's implementation. https://bugzilla.gnome.org/show_bug.cgi?id=720806
-rw-r--r--daemon/gvfsbackendtrash.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/daemon/gvfsbackendtrash.c b/daemon/gvfsbackendtrash.c
index 1f6e6244..8cddeae8 100644
--- a/daemon/gvfsbackendtrash.c
+++ b/daemon/gvfsbackendtrash.c
@@ -23,6 +23,7 @@
#include "gvfsjobqueryinfo.h"
#include "gvfsjobenumerate.h"
#include "gvfsjobseekread.h"
+#include "gvfsjobqueryinforead.h"
#include "gvfsjobread.h"
#include "gvfsdaemonutils.h"
@@ -312,6 +313,33 @@ trash_backend_seek_on_read (GVfsBackend *backend,
return TRUE;
}
+static void
+trash_backend_query_info_on_read (GVfsBackend *backend,
+ GVfsJobQueryInfoRead *job,
+ GVfsBackendHandle handle,
+ GFileInfo *info,
+ GFileAttributeMatcher *matcher)
+{
+ GError *error = NULL;
+ GFileInfo *real_info;
+
+ real_info = g_file_input_stream_query_info (handle,
+ job->attributes,
+ G_VFS_JOB (job)->cancellable,
+ &error);
+ if (real_info)
+ {
+ g_file_info_copy_into (real_info, info);
+ g_vfs_job_succeeded (G_VFS_JOB (job));
+ g_object_unref (real_info);
+ }
+ else
+ {
+ g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
+ }
+}
+
static gboolean
trash_backend_close_read (GVfsBackend *backend,
GVfsJobCloseRead *job,
@@ -871,6 +899,7 @@ g_vfs_backend_trash_class_init (GVfsBackendTrashClass *class)
backend_class->try_open_for_read = trash_backend_open_for_read;
backend_class->try_read = trash_backend_read;
backend_class->try_seek_on_read = trash_backend_seek_on_read;
+ backend_class->query_info_on_read = trash_backend_query_info_on_read;
backend_class->try_close_read = trash_backend_close_read;
backend_class->try_query_info = trash_backend_query_info;
backend_class->try_query_fs_info = trash_backend_query_fs_info;