thunar/thunar-file.c | 30 +++++++++++++++++++++++++++++- thunarx/thunarx.symbols | 5 +++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index 6ec3cea1..bc28641e 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -50,6 +50,8 @@ #include #endif +#include + #include #include #include @@ -3390,13 +3392,39 @@ thunar_file_is_renameable (const ThunarFile *file) gboolean thunar_file_can_be_trashed (const ThunarFile *file) { + gboolean retval; + _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); if (file->info == NULL) return FALSE; - return g_file_info_get_attribute_boolean (file->info, + retval = g_file_info_get_attribute_boolean (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH); + if (retval) + { + char *filepath; + + filepath = g_file_get_path (file->gfile); + if (filepath != NULL) + { + struct statfs fs_info; + + /* Don't try create trash on Windows and fuse filesystems. */ + if (statfs (filepath, &fs_info) == 0 && + (fs_info.f_type == 0x5346544E /* ntfs */ + || fs_info.f_type == 0x4D44 /* msdos */ + || fs_info.f_type == 0x4006 /* fat */ + || fs_info.f_type == 0x65735546 /* fuseblk */ + || fs_info.f_type == 0x6969 /* nfs */ + || fs_info.f_type == 0xFF534D42)) /* cifs */ + retval = FALSE; + + g_free (filepath); + } + } + + return retval; } diff --git a/thunarx/thunarx.symbols b/thunarx/thunarx.symbols index d4b5469c..f3d3616f 100644 --- a/thunarx/thunarx.symbols +++ b/thunarx/thunarx.symbols @@ -99,6 +99,11 @@ thunarx_provider_plugin_add_interface thunarx_provider_plugin_register_enum thunarx_provider_plugin_register_flags +/* ThunarxProviderModule methods */ +thunarx_provider_module_get_type +thunarx_provider_module_list_types +thunarx_provider_module_new + /* ThunarxRenamer methods */ thunarx_renamer_get_type G_GNUC_CONST thunarx_renamer_get_help_url