summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-file-utilities.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-11-23 23:39:10 +0100
committerVictor Kareh <[email protected]>2020-12-11 13:18:31 -0500
commit7f9200cbdd5678a39262321538813f1963b807cb (patch)
treeec7da321d1a3fc923ecca46bda717ef42a8b1606 /libcaja-private/caja-file-utilities.c
parent4a7fe0f438ab37bcb483ac63627b86872da6c1b8 (diff)
downloadcaja-7f9200cbdd5678a39262321538813f1963b807cb.tar.bz2
caja-7f9200cbdd5678a39262321538813f1963b807cb.tar.xz
caja-directory-async: trust also launchers from user desktop
Diffstat (limited to 'libcaja-private/caja-file-utilities.c')
-rw-r--r--libcaja-private/caja-file-utilities.c25
1 files changed, 25 insertions, 0 deletions
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)