[gvfs/wip/antoniof/set-preview-type-explicitly: 4/4] daemon: Set filesystem::use-preview explicitly
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/antoniof/set-preview-type-explicitly: 4/4] daemon: Set filesystem::use-preview explicitly
- Date: Sun, 17 Jan 2021 12:12:26 +0000 (UTC)
commit c8a1c5000cae15c50158b6dfc3148ba4ecad3f43
Author: António Fernandes <antoniof gnome org>
Date: Sun Jan 17 10:44:03 2021 +0000
daemon: Set filesystem::use-preview explicitly
It can be correctly implied from the value of filesystem::remote for
many backends, but let's make it explicit for them too.
Fixes https://gitlab.gnome.org/GNOME/gvfs/-/issues/497
daemon/gvfsbackendafp.c | 1 +
daemon/gvfsbackendburn.c | 1 +
daemon/gvfsbackenddav.c | 3 +++
daemon/gvfsbackendftp.c | 1 +
daemon/gvfsbackendgoogle.c | 1 +
daemon/gvfsbackendhttp.c | 1 +
daemon/gvfsbackendlocaltest.c | 1 +
daemon/gvfsbackendnfs.c | 3 +++
daemon/gvfsbackendsftp.c | 3 +++
daemon/gvfsbackendsmb.c | 1 +
10 files changed, 16 insertions(+)
---
diff --git a/daemon/gvfsbackendafp.c b/daemon/gvfsbackendafp.c
index 48aa7d75..9db8184e 100644
--- a/daemon/gvfsbackendafp.c
+++ b/daemon/gvfsbackendafp.c
@@ -1821,6 +1821,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_IF_ALWAYS);
if (g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE))
vol_bitmap |= AFP_VOLUME_BITMAP_EXT_BYTES_TOTAL_BIT;
diff --git a/daemon/gvfsbackendburn.c b/daemon/gvfsbackendburn.c
index 16909ff5..716811a9 100644
--- a/daemon/gvfsbackendburn.c
+++ b/daemon/gvfsbackendburn.c
@@ -1033,6 +1033,7 @@ try_query_fs_info (GVfsBackend *backend,
{
g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "burn");
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_IF_LOCAL);
g_vfs_job_succeeded (G_VFS_JOB (job));
return TRUE;
}
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index ab680daf..12de62e5 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -2231,6 +2231,9 @@ do_query_fs_info (GVfsBackend *backend,
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_IF_ALWAYS);
if (! (g_file_attribute_matcher_matches (attribute_matcher,
G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index 71dae102..8f69e44b 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -1728,6 +1728,7 @@ try_query_fs_info (GVfsBackend *backend,
{
g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "ftp");
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_IF_ALWAYS);
g_vfs_job_succeeded (G_VFS_JOB (job));
return TRUE;
}
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index f4459781..777acb8a 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -3103,6 +3103,7 @@ g_vfs_backend_google_query_fs_info (GVfsBackend *_self,
type = g_mount_spec_get_type (spec);
g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, type);
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_IF_ALWAYS);
if (g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_FILESYSTEM_FREE) ||
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c
index aca1525d..1120d2f0 100644
--- a/daemon/gvfsbackendhttp.c
+++ b/daemon/gvfsbackendhttp.c
@@ -682,6 +682,7 @@ try_query_fs_info (GVfsBackend *backend,
{
g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "http");
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_IF_ALWAYS);
g_vfs_job_succeeded (G_VFS_JOB (job));
return TRUE;
}
diff --git a/daemon/gvfsbackendlocaltest.c b/daemon/gvfsbackendlocaltest.c
index 271c899c..1eeb700d 100644
--- a/daemon/gvfsbackendlocaltest.c
+++ b/daemon/gvfsbackendlocaltest.c
@@ -390,6 +390,7 @@ do_query_fs_info (GVfsBackend *backend,
g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "localtest");
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_IF_LOCAL);
file = get_g_file_from_local (filename, G_VFS_JOB (job));
diff --git a/daemon/gvfsbackendnfs.c b/daemon/gvfsbackendnfs.c
index a583a8a6..9101e13f 100644
--- a/daemon/gvfsbackendnfs.c
+++ b/daemon/gvfsbackendnfs.c
@@ -1607,6 +1607,9 @@ try_query_fs_info (GVfsBackend *backend,
G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "nfs");
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_IF_ALWAYS);
if (g_file_attribute_matcher_matches (matcher,
G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 530a4237..61c20a39 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -4793,6 +4793,9 @@ try_query_fs_info (GVfsBackend *backend,
G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "sftp");
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_IF_ALWAYS);
if (has_extension (op_backend, SFTP_EXT_OPENSSH_STATVFS) &&
(g_file_attribute_matcher_matches (matcher,
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 1bd4baab..33d1a209 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1600,6 +1600,7 @@ do_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_IF_ALWAYS);
if (g_file_attribute_matcher_matches (attribute_matcher,
G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]