From 7f9200cbdd5678a39262321538813f1963b807cb Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 23 Nov 2020 23:39:10 +0100 Subject: caja-directory-async: trust also launchers from user desktop --- libcaja-private/caja-file-utilities.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'libcaja-private/caja-file-utilities.c') diff --git a/libcaja-private/caja-file-utilities.c b/libcaja-private/caja-file-utilities.c index 84198bfa..0049514f 100644 --- a/libcaja-private/caja-file-utilities.c +++ b/libcaja-private/caja-file-utilities.c @@ -1134,6 +1134,31 @@ caja_is_in_system_dir (GFile *file) return res; } +gboolean +caja_is_in_desktop_dir (GFile *file) +{ + char *path; + char *dirname; + gboolean res = FALSE; + + if (!g_file_is_native (file)) + { + return res; + } + + path = g_file_get_path (file); + dirname = g_path_get_dirname (path); + if (g_strcmp0 (dirname, g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP)) == 0) + { + res = TRUE; + } + + g_free (path); + g_free (dirname); + + return res; +} + GHashTable * caja_trashed_files_get_original_directories (GList *files, GList **unhandled_files) -- cgit v1.2.1