summaryrefslogtreecommitdiff
path: root/src/nautilus-file.c
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-08-30 13:41:59 -0700
committerCorey Berla <corey@berla.me>2022-08-30 13:41:59 -0700
commit762152166a858b9f46eabd55fbc9e887e9d4f36d (patch)
tree23bba97f14dc1aa1b971b7526ce4709e7e35e55b /src/nautilus-file.c
parente63de39fb80efcdace9db5b661969c25f0a4c2d9 (diff)
downloadnautilus-762152166a858b9f46eabd55fbc9e887e9d4f36d.tar.gz
file: Check if special dir is the home directory
xdg-user-dirs is intentionally configured to disable a special directory when it's set to $HOME. Let's check if the file is pointing to the home directory and return early. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2459
Diffstat (limited to 'src/nautilus-file.c')
-rw-r--r--src/nautilus-file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 2807c85d9..6a259816a 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -8007,6 +8007,12 @@ nautilus_file_is_user_special_directory (NautilusFile *file,
gboolean is_special_dir;
const gchar *special_dir;
+ if (nautilus_file_is_home (file))
+ {
+ /* A xdg-user-dir is disabled by setting it to the home directory */
+ return FALSE;
+ }
+
special_dir = g_get_user_special_dir (special_directory);
is_special_dir = FALSE;