[gvfs] daemon: Set G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE attribute



commit 96771e1728017199b5e16d6c32db45e37a87d140
Author: Ondrej Holy <oholy redhat com>
Date:   Wed Jun 22 14:04:02 2016 +0200

    daemon: Set G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE attribute
    
    Mark all network-based backends as remote. This is useful to remove
    some hardcoded lists of filesystem types in GTK+.
    
    Bump required GLib version accordingly.

 configure.ac                  |    2 +-
 daemon/gvfsbackendafc.c       |    1 +
 daemon/gvfsbackendafp.c       |    2 +-
 daemon/gvfsbackendafpbrowse.c |    1 +
 daemon/gvfsbackendarchive.c   |    1 +
 daemon/gvfsbackendburn.c      |    1 +
 daemon/gvfsbackendcdda.c      |    1 +
 daemon/gvfsbackendcomputer.c  |    1 +
 daemon/gvfsbackenddav.c       |    3 +++
 daemon/gvfsbackenddnssd.c     |    1 +
 daemon/gvfsbackendftp.c       |    1 +
 daemon/gvfsbackendgoogle.c    |    1 +
 daemon/gvfsbackendgphoto2.c   |    1 +
 daemon/gvfsbackendhttp.c      |    1 +
 daemon/gvfsbackendlocaltest.c |    1 +
 daemon/gvfsbackendmtp.c       |    1 +
 daemon/gvfsbackendnetwork.c   |    1 +
 daemon/gvfsbackendnfs.c       |    2 ++
 daemon/gvfsbackendrecent.c    |    3 +++
 daemon/gvfsbackendsftp.c      |    2 ++
 daemon/gvfsbackendsmb.c       |    1 +
 daemon/gvfsbackendsmbbrowse.c |    1 +
 daemon/gvfsbackendtrash.c     |    3 +++
 23 files changed, 31 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 000902d..0c43829 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,7 @@ GTK_DOC_CHECK
 DISTCHECK_CONFIGURE_FLAGS="--enable-gtk-doc"
 AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
 
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.49.1 gobject-2.0 gmodule-no-export-2.0 gio-unix-2.0 gio-2.0])
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.49.3 gobject-2.0 gmodule-no-export-2.0 gio-unix-2.0 gio-2.0])
 
 PKG_CHECK_MODULES([DBUS], [dbus-1])
 
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index 2f264ab..49c5908 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -2233,6 +2233,7 @@ g_vfs_backend_afc_query_fs_info (GVfsBackend *backend,
   self = G_VFS_BACKEND_AFC(backend);
 
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "afc");
+  g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, FALSE);
 
   if (!self->connected)
     {
diff --git a/daemon/gvfsbackendafp.c b/daemon/gvfsbackendafp.c
index 090d1de..41e6fd5 100644
--- a/daemon/gvfsbackendafp.c
+++ b/daemon/gvfsbackendafp.c
@@ -1820,7 +1820,7 @@ try_query_fs_info (GVfsBackend *backend,
   guint16 vol_bitmap = 0;
 
   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);
   
   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/gvfsbackendafpbrowse.c b/daemon/gvfsbackendafpbrowse.c
index 514bd4b..41e05a3 100644
--- a/daemon/gvfsbackendafpbrowse.c
+++ b/daemon/gvfsbackendafpbrowse.c
@@ -554,6 +554,7 @@ try_query_fs_info (GVfsBackend *backend,
                    GFileAttributeMatcher *matcher)
 {
   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_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendarchive.c b/daemon/gvfsbackendarchive.c
index f5b931f..1d4f7e1 100644
--- a/daemon/gvfsbackendarchive.c
+++ b/daemon/gvfsbackendarchive.c
@@ -906,6 +906,7 @@ try_query_fs_info (GVfsBackend *backend,
   GVfsBackendArchive *ba = G_VFS_BACKEND_ARCHIVE (backend);
 
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "archive");
+  g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, FALSE);
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, TRUE);
   g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL);
   g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, ba->size);
diff --git a/daemon/gvfsbackendburn.c b/daemon/gvfsbackendburn.c
index 928387c..d26468c 100644
--- a/daemon/gvfsbackendburn.c
+++ b/daemon/gvfsbackendburn.c
@@ -1030,6 +1030,7 @@ try_query_fs_info (GVfsBackend *backend,
                    GFileAttributeMatcher *matcher)
 {
   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_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendcdda.c b/daemon/gvfsbackendcdda.c
index b3ffb70..bd10dd0 100644
--- a/daemon/gvfsbackendcdda.c
+++ b/daemon/gvfsbackendcdda.c
@@ -1093,6 +1093,7 @@ do_query_fs_info (GVfsBackend *backend,
   GVfsBackendCdda *cdda_backend = G_VFS_BACKEND_CDDA (backend);
 
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "cdda");
+  g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, FALSE);
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, TRUE);
   g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL);
 
diff --git a/daemon/gvfsbackendcomputer.c b/daemon/gvfsbackendcomputer.c
index 456bb15..4b1ff4f 100644
--- a/daemon/gvfsbackendcomputer.c
+++ b/daemon/gvfsbackendcomputer.c
@@ -1423,6 +1423,7 @@ try_query_fs_info (GVfsBackend *backend,
                    GFileAttributeMatcher *matcher)
 {
   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_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 4e28643..b3aa2c9 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -2128,6 +2128,9 @@ do_query_fs_info (GVfsBackend           *backend,
   g_file_info_set_attribute_string (info,
                                     G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
                                     "webdav");
+  g_file_info_set_attribute_boolean (info,
+                                     G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE,
+                                     TRUE);
 
   if (! (g_file_attribute_matcher_matches (attribute_matcher,
                                            G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
diff --git a/daemon/gvfsbackenddnssd.c b/daemon/gvfsbackenddnssd.c
index e51fbba..51eac9b 100644
--- a/daemon/gvfsbackenddnssd.c
+++ b/daemon/gvfsbackenddnssd.c
@@ -821,6 +821,7 @@ try_query_fs_info (GVfsBackend *backend,
                    GFileAttributeMatcher *matcher)
 {
   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_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index d9feb62..2b758e6 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -1741,6 +1741,7 @@ try_query_fs_info (GVfsBackend *backend,
                    GFileAttributeMatcher *matcher)
 {
   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_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index c7ca268..442e031 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -1977,6 +1977,7 @@ g_vfs_backend_google_query_fs_info (GVfsBackend           *_self,
   spec = g_vfs_backend_get_mount_spec (_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_vfs_job_succeeded (G_VFS_JOB (job));
 
diff --git a/daemon/gvfsbackendgphoto2.c b/daemon/gvfsbackendgphoto2.c
index bfa85ac..6c17663 100644
--- a/daemon/gvfsbackendgphoto2.c
+++ b/daemon/gvfsbackendgphoto2.c
@@ -2389,6 +2389,7 @@ do_query_fs_info (GVfsBackend *backend,
   g_debug ("query_fs_info (%s)\n", filename);
 
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "gphoto2");
+  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_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, 
!gphoto2_backend->can_write);
 
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c
index 317c8ed..6023add 100644
--- a/daemon/gvfsbackendhttp.c
+++ b/daemon/gvfsbackendhttp.c
@@ -682,6 +682,7 @@ try_query_fs_info (GVfsBackend *backend,
                    GFileAttributeMatcher *matcher)
 {
   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_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendlocaltest.c b/daemon/gvfsbackendlocaltest.c
index 80af88c..271c899 100644
--- a/daemon/gvfsbackendlocaltest.c
+++ b/daemon/gvfsbackendlocaltest.c
@@ -389,6 +389,7 @@ do_query_fs_info (GVfsBackend *backend,
   g_print ("(II) try_query_fs_info (filename = %s) \n", filename);
 
   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);
 
   file = get_g_file_from_local (filename, G_VFS_JOB (job));
 
diff --git a/daemon/gvfsbackendmtp.c b/daemon/gvfsbackendmtp.c
index 6b4f861..09eed94 100644
--- a/daemon/gvfsbackendmtp.c
+++ b/daemon/gvfsbackendmtp.c
@@ -1225,6 +1225,7 @@ get_storage_info (LIBMTP_devicestorage_t *storage, GFileInfo *info) {
   g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE, storage->FreeSpaceInBytes);
   g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, storage->MaxCapacity);
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "mtpfs");
+  g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, FALSE);
 
   g_debug ("(II) get_storage_info done.\n");
 }
diff --git a/daemon/gvfsbackendnetwork.c b/daemon/gvfsbackendnetwork.c
index 4530705..068ccb2 100644
--- a/daemon/gvfsbackendnetwork.c
+++ b/daemon/gvfsbackendnetwork.c
@@ -866,6 +866,7 @@ try_query_fs_info (GVfsBackend *backend,
                    GFileAttributeMatcher *matcher)
 {
   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_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendnfs.c b/daemon/gvfsbackendnfs.c
index 617332b..c7edffd 100644
--- a/daemon/gvfsbackendnfs.c
+++ b/daemon/gvfsbackendnfs.c
@@ -1603,6 +1603,8 @@ try_query_fs_info (GVfsBackend *backend,
 
   g_file_info_set_attribute_string (info,
                                     G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "nfs");
+  g_file_info_set_attribute_boolean (info,
+                                     G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, TRUE);
 
   if (g_file_attribute_matcher_matches (matcher,
                                         G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
diff --git a/daemon/gvfsbackendrecent.c b/daemon/gvfsbackendrecent.c
index 24d91a4..7db60cf 100644
--- a/daemon/gvfsbackendrecent.c
+++ b/daemon/gvfsbackendrecent.c
@@ -606,6 +606,9 @@ recent_backend_query_fs_info (GVfsBackend           *vfs_backend,
   g_file_info_set_attribute_string (info,
                                     G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
                                     "recent");
+  g_file_info_set_attribute_boolean (info,
+                                     G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE,
+                                     FALSE);
 
   g_file_info_set_attribute_boolean (info,
                                      G_FILE_ATTRIBUTE_FILESYSTEM_READONLY,
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 50f9e2d..1e3d1fc 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -4597,6 +4597,8 @@ try_query_fs_info (GVfsBackend *backend,
 
   g_file_info_set_attribute_string (info,
                                     G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "sftp");
+  g_file_info_set_attribute_boolean (info,
+                                     G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, TRUE);
 
   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 6e4bc41..cc23629 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1732,6 +1732,7 @@ do_query_fs_info (GVfsBackend *backend,
   int res, saved_errno;
 
   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);
 
   if (g_file_attribute_matcher_matches (attribute_matcher,
                                        G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) ||
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 2aa0826..a811c5e 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -1520,6 +1520,7 @@ try_query_fs_info (GVfsBackend *backend,
                    GFileAttributeMatcher *matcher)
 {
   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_vfs_job_succeeded (G_VFS_JOB (job));
   return TRUE;
 }
diff --git a/daemon/gvfsbackendtrash.c b/daemon/gvfsbackendtrash.c
index f90d69b..95f39d7 100644
--- a/daemon/gvfsbackendtrash.c
+++ b/daemon/gvfsbackendtrash.c
@@ -806,6 +806,9 @@ trash_backend_query_fs_info (GVfsBackend           *vfs_backend,
   g_file_info_set_attribute_string (info,
                                     G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
                                     "trash");
+  g_file_info_set_attribute_boolean (info,
+                                     G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE,
+                                     FALSE);
 
   g_file_info_set_attribute_boolean (info,
                                      G_FILE_ATTRIBUTE_FILESYSTEM_READONLY,


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