[nautilus/wip/corey/user-share] file: Check if special dir is the home directory




commit 762152166a858b9f46eabd55fbc9e887e9d4f36d
Author: Corey Berla <corey berla me>
Date:   Tue Aug 30 13:41:59 2022 -0700

    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

 src/nautilus-file.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]