[gvfs] job: Honor attribute mask in query info



commit cf8a6cc2d9b13dc8fe949fa8b9eb320f8f06985e
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Feb 26 14:20:48 2015 +0100

    job: Honor attribute mask in query info
    
    Unwanted attributes are sent from some backends (e.g. ftp), because
    g_file_info_copy_info is used and thus source attribute matcher is replaced.
    Apply attribute mask before sending as it is done in gvfsjobeneumerate
    to fix this issue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745212

 daemon/gvfsjobqueryfsinfo.c    |    3 +++
 daemon/gvfsjobqueryinfo.c      |    2 ++
 daemon/gvfsjobqueryinforead.c  |    5 ++++-
 daemon/gvfsjobqueryinfowrite.c |    5 ++++-
 4 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsjobqueryfsinfo.c b/daemon/gvfsjobqueryfsinfo.c
index f5f9791..bbe5465 100644
--- a/daemon/gvfsjobqueryfsinfo.c
+++ b/daemon/gvfsjobqueryfsinfo.c
@@ -156,6 +156,9 @@ create_reply (GVfsJob *job,
                                      G_FILE_ATTRIBUTE_GVFS_BACKEND,
                                      type);
 
+  g_file_info_set_attribute_mask (op_job->file_info,
+                                  op_job->attribute_matcher);
+
   gvfs_dbus_mount_complete_query_filesystem_info (object, invocation,
       _g_dbus_append_file_info (op_job->file_info));
 }
diff --git a/daemon/gvfsjobqueryinfo.c b/daemon/gvfsjobqueryinfo.c
index b963c2b..7d7a1e0 100644
--- a/daemon/gvfsjobqueryinfo.c
+++ b/daemon/gvfsjobqueryinfo.c
@@ -162,6 +162,8 @@ create_reply (GVfsJob *job,
                                op_job->attribute_matcher,
                                op_job->file_info,
                                op_job->uri);
+  g_file_info_set_attribute_mask (op_job->file_info,
+                                  op_job->attribute_matcher);
 
   gvfs_dbus_mount_complete_query_info (object, invocation,
       _g_dbus_append_file_info (op_job->file_info));
diff --git a/daemon/gvfsjobqueryinforead.c b/daemon/gvfsjobqueryinforead.c
index 39a9347..3e04d79 100644
--- a/daemon/gvfsjobqueryinforead.c
+++ b/daemon/gvfsjobqueryinforead.c
@@ -104,7 +104,10 @@ send_reply (GVfsJob *job)
   if (job->failed)
     g_vfs_channel_send_error (G_VFS_CHANNEL (op_job->channel), job->error);
   else
-    g_vfs_channel_send_info (G_VFS_CHANNEL (op_job->channel), op_job->file_info);
+    {
+      g_file_info_set_attribute_mask (op_job->file_info, op_job->attribute_matcher);
+      g_vfs_channel_send_info (G_VFS_CHANNEL (op_job->channel), op_job->file_info);
+    }
 }
 
 static void
diff --git a/daemon/gvfsjobqueryinfowrite.c b/daemon/gvfsjobqueryinfowrite.c
index e2c9327..474cbfd 100644
--- a/daemon/gvfsjobqueryinfowrite.c
+++ b/daemon/gvfsjobqueryinfowrite.c
@@ -104,7 +104,10 @@ send_reply (GVfsJob *job)
   if (job->failed)
     g_vfs_channel_send_error (G_VFS_CHANNEL (op_job->channel), job->error);
   else
-    g_vfs_channel_send_info (G_VFS_CHANNEL (op_job->channel), op_job->file_info);
+    {
+      g_file_info_set_attribute_mask (op_job->file_info, op_job->attribute_matcher);
+      g_vfs_channel_send_info (G_VFS_CHANNEL (op_job->channel), op_job->file_info);
+    }
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]