summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2013-12-18 13:59:24 +0200
committerRoss Lagerwall <rosslagerwall@gmail.com>2014-04-30 08:29:12 +0100
commit41790cb90f2c4b0c647ea1df211387c9effa6133 (patch)
treeec81a3d8d1a9cf3fe5da34ad11926e7d1615f139
parentd872d9ca4437c6e24948d8a730dea884c4299783 (diff)
downloadgvfs-41790cb90f2c4b0c647ea1df211387c9effa6133.tar.gz
recent: 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/gvfsbackendrecent.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/daemon/gvfsbackendrecent.c b/daemon/gvfsbackendrecent.c
index faac3382..e9dcfb7d 100644
--- a/daemon/gvfsbackendrecent.c
+++ b/daemon/gvfsbackendrecent.c
@@ -21,6 +21,7 @@
#include "gvfsjobqueryinfo.h"
#include "gvfsjobenumerate.h"
#include "gvfsjobseekread.h"
+#include "gvfsjobqueryinforead.h"
#include "gvfsjobread.h"
typedef GVfsBackendClass GVfsBackendRecentClass;
@@ -200,6 +201,33 @@ recent_backend_seek_on_read (GVfsBackend *vfs_backend,
return TRUE;
}
+static void
+recent_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
recent_backend_close_read (GVfsBackend *vfs_backend,
GVfsJobCloseRead *job,
@@ -681,6 +709,7 @@ g_vfs_backend_recent_class_init (GVfsBackendRecentClass *class)
backend_class->try_open_for_read = recent_backend_open_for_read;
backend_class->try_read = recent_backend_read;
backend_class->try_seek_on_read = recent_backend_seek_on_read;
+ backend_class->query_info_on_read = recent_backend_query_info_on_read;
backend_class->try_close_read = recent_backend_close_read;
backend_class->try_query_info = recent_backend_query_info;
backend_class->try_query_fs_info = recent_backend_query_fs_info;