[nautilus] window-slot: Show special-directory info bar for Public folder



commit 0aa1b66ffa07060bb7c2dae14978a7f71e156626
Author: Corey Berla <corey berla me>
Date:   Thu Jul 14 16:18:57 2022 -0700

    window-slot: Show special-directory info bar for Public folder
    
    Check for schema org.gnome.desktop.file-sharing to verify
    gnome-user-share is installed.

 src/nautilus-window-slot.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 7e94ffcab..664754e63 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -65,6 +65,8 @@ enum
     NUM_PROPERTIES
 };
 
+#define FILE_SHARING_SCHEMA_ID "org.gnome.desktop.file-sharing"
+
 struct _NautilusWindowSlot
 {
     GtkBox parent_instance;
@@ -2741,6 +2743,11 @@ nautilus_window_slot_setup_extra_location_widgets (NautilusWindowSlot *self)
         {
             nautilus_window_slot_show_special_location_bar (self, NAUTILUS_SPECIAL_LOCATION_SCRIPTS);
         }
+        else if (check_schema_available (FILE_SHARING_SCHEMA_ID) &&
+                 nautilus_file_is_user_special_directory (file, G_USER_DIRECTORY_PUBLIC_SHARE))
+        {
+            nautilus_window_slot_show_special_location_bar (self, NAUTILUS_SPECIAL_LOCATION_SHARING);
+        }
 
         g_object_unref (scripts_file);
         nautilus_file_unref (file);


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