mirror of https://gitee.com/openkylin/glib2.0.git
fix-trash-issue-in-data-usershare
=================================================================== Gbp-Pq: Name 20210726-fix-trash-issue-in-data-usershare.patch
This commit is contained in:
parent
2c21bc1043
commit
d3c09df1b3
|
@ -1984,6 +1984,7 @@ g_local_file_trash (GFile *file,
|
|||
GVfsClass *class;
|
||||
GVfs *vfs;
|
||||
int errsv;
|
||||
gboolean is_local_file_in_usershare = FALSE;
|
||||
|
||||
if (glib_should_use_portal ())
|
||||
return g_trash_portal_trash_file (file, error);
|
||||
|
@ -2038,7 +2039,8 @@ g_local_file_trash (GFile *file,
|
|||
g_free (path);
|
||||
}
|
||||
|
||||
if (file_stat.st_dev == home_stat.st_dev)
|
||||
is_local_file_in_usershare = g_str_has_prefix(local->filename, "/data/usershare");
|
||||
if (file_stat.st_dev == home_stat.st_dev && !is_local_file_in_usershare)
|
||||
{
|
||||
is_homedir_trash = TRUE;
|
||||
errno = 0;
|
||||
|
@ -2077,7 +2079,7 @@ g_local_file_trash (GFile *file,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (ignore_trash_path (topdir))
|
||||
if (ignore_trash_path (topdir) && !is_local_file_in_usershare)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
_("Trashing on system internal mounts is not supported"));
|
||||
|
|
Loading…
Reference in New Issue