[gvfs/wip/antoniof/set-preview-type-explicitly: 3/4] daemon: Set G_FILESYSTEM_PREVIEW_TYPE_NEVER in browse backends




commit c44f61029186f6a501038e7dc244dc30e6f1fe82
Author: António Fernandes <antoniof gnome org>
Date:   Sat Jan 16 23:34:37 2021 +0000

    daemon: Set G_FILESYSTEM_PREVIEW_TYPE_NEVER in browse backends
    
    These backends are special and their "files" are links to locations
    from other backends. I doesn't make sense to preview them.
    
    https://gitlab.gnome.org/GNOME/gvfs/-/issues/497

 daemon/gvfsbackendafpbrowse.c | 1 +
 daemon/gvfsbackendcomputer.c  | 1 +
 daemon/gvfsbackenddnssd.c     | 1 +
 daemon/gvfsbackendnetwork.c   | 1 +
 daemon/gvfsbackendsmbbrowse.c | 1 +
 5 files changed, 5 insertions(+)
---
diff --git a/daemon/gvfsbackendafpbrowse.c b/daemon/gvfsbackendafpbrowse.c
index a59160da..9bda1c70 100644
--- a/daemon/gvfsbackendafpbrowse.c
+++ b/daemon/gvfsbackendafpbrowse.c
@@ -540,6 +540,7 @@ try_query_fs_info (GVfsBackend *backend,
 {
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "afp");
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, TRUE);
+  g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
G_FILESYSTEM_PREVIEW_TYPE_NEVER);
   g_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendcomputer.c b/daemon/gvfsbackendcomputer.c
index 21ac6bf7..f6cb44ff 100644
--- a/daemon/gvfsbackendcomputer.c
+++ b/daemon/gvfsbackendcomputer.c
@@ -1424,6 +1424,7 @@ try_query_fs_info (GVfsBackend *backend,
 {
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "computer");
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, FALSE);
+  g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
G_FILESYSTEM_PREVIEW_TYPE_NEVER);
   g_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackenddnssd.c b/daemon/gvfsbackenddnssd.c
index da549029..f9270aa4 100644
--- a/daemon/gvfsbackenddnssd.c
+++ b/daemon/gvfsbackenddnssd.c
@@ -842,6 +842,7 @@ try_query_fs_info (GVfsBackend *backend,
 {
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "dns-sd");
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, TRUE);
+  g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
G_FILESYSTEM_PREVIEW_TYPE_NEVER);
   g_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendnetwork.c b/daemon/gvfsbackendnetwork.c
index ad9d68e8..87cfec77 100644
--- a/daemon/gvfsbackendnetwork.c
+++ b/daemon/gvfsbackendnetwork.c
@@ -868,6 +868,7 @@ try_query_fs_info (GVfsBackend *backend,
 {
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "network");
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, TRUE);
+  g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
G_FILESYSTEM_PREVIEW_TYPE_NEVER);
   g_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 0bbbe6a9..57bae9db 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -1506,6 +1506,7 @@ try_query_fs_info (GVfsBackend *backend,
 {
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "cifs");
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, TRUE);
+  g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
G_FILESYSTEM_PREVIEW_TYPE_NEVER);
   g_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }


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