summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2015-08-26 17:46:57 +0200
committerOndrej Holy <oholy@redhat.com>2015-09-23 10:17:16 +0200
commit1a4e823966e31f72eedfec536cb150c629e126a7 (patch)
tree3dfb63c282f61d7dc6d96c56da5440e12faa5d80
parente1a3c297aa38c86b19705a03555d322eaa944ff7 (diff)
downloadgvfs-1a4e823966e31f72eedfec536cb150c629e126a7.tar.gz
Mark files as untrashable for main backends
Otherwise nautilus will offer the wrong action in its UI. https://bugzilla.gnome.org/show_bug.cgi?id=753934
-rw-r--r--daemon/gvfsafpserver.c1
-rw-r--r--daemon/gvfsbackendafc.c2
-rw-r--r--daemon/gvfsbackendsftp.c2
-rw-r--r--daemon/gvfsbackendsmb.c2
-rw-r--r--daemon/gvfsftpdircache.c2
5 files changed, 9 insertions, 0 deletions
diff --git a/daemon/gvfsafpserver.c b/daemon/gvfsafpserver.c
index 69e04b5a..c10b66ff 100644
--- a/daemon/gvfsafpserver.c
+++ b/daemon/gvfsafpserver.c
@@ -1507,6 +1507,7 @@ g_vfs_afp_server_fill_info (GVfsAfpServer *server,
else
g_file_info_set_file_type (info, G_FILE_TYPE_REGULAR);
+ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE);
start_pos = g_vfs_afp_reply_get_pos (reply);
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index d093ccea..5762571c 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -1641,6 +1641,8 @@ g_vfs_backend_afc_set_info_from_afcinfo (GVfsBackendAfc *self,
g_file_info_set_is_hidden (info, hidden);
+ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE);
+
/* Check for matching thumbnail in .MISC directory */
if (g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_PREVIEW_ICON) &&
self->mode == ACCESS_MODE_AFC &&
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index c301dc99..a9dc7814 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -2501,6 +2501,8 @@ parse_attributes (GVfsBackendSftp *backend,
}
+ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE);
+
g_file_info_set_file_type (info, type);
if (flags & SSH_FILEXFER_ATTR_ACMODTIME)
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 5e75a731..de1161d6 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1656,6 +1656,8 @@ set_info_from_stat (GVfsBackendSmb *backend,
if (!(statbuf->st_mode & S_IWUSR) && S_ISREG (statbuf->st_mode))
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, FALSE);
+ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE);
+
g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_ACCESS, statbuf->st_atime);
#if defined (HAVE_STRUCT_STAT_ST_ATIMENSEC)
g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_TIME_ACCESS_USEC, statbuf->st_atimensec / 1000);
diff --git a/daemon/gvfsftpdircache.c b/daemon/gvfsftpdircache.c
index 365b11bb..b123e4e8 100644
--- a/daemon/gvfsftpdircache.c
+++ b/daemon/gvfsftpdircache.c
@@ -693,6 +693,8 @@ g_vfs_ftp_dir_cache_funcs_process (GInputStream * stream,
g_debug ("# unknown listing format\n");
}
+ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE);
+
if (file_type == G_FILE_TYPE_UNKNOWN)
{
file_type = type == 'f' ? G_FILE_TYPE_REGULAR :