mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
glocalfile: Update G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH logic
Change G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH logic to be consistent with recent g_local_file_trash changes, i.e. set this to FALSE for locations on system-internal mounts. https://gitlab.gnome.org/GNOME/glib/issues/251
This commit is contained in:
parent
15a47afb0e
commit
6dfd0a00e7
@ -1769,6 +1769,7 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev)
|
|||||||
char uid_str[32];
|
char uid_str[32];
|
||||||
GStatBuf global_stat, trash_stat;
|
GStatBuf global_stat, trash_stat;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
|
GUnixMountEntry *mount;
|
||||||
|
|
||||||
if (g_once_init_enter (&home_dev_set))
|
if (g_once_init_enter (&home_dev_set))
|
||||||
{
|
{
|
||||||
@ -1787,6 +1788,16 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev)
|
|||||||
if (topdir == NULL)
|
if (topdir == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
mount = g_unix_mount_at (topdir, NULL);
|
||||||
|
if (mount == NULL || g_unix_mount_is_system_internal (mount))
|
||||||
|
{
|
||||||
|
g_clear_pointer (&mount, g_unix_mount_free);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_clear_pointer (&mount, g_unix_mount_free);
|
||||||
|
|
||||||
globaldir = g_build_filename (topdir, ".Trash", NULL);
|
globaldir = g_build_filename (topdir, ".Trash", NULL);
|
||||||
if (g_lstat (globaldir, &global_stat) == 0 &&
|
if (g_lstat (globaldir, &global_stat) == 0 &&
|
||||||
S_ISDIR (global_stat.st_mode) &&
|
S_ISDIR (global_stat.st_mode) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user