[Xfce4-commits] [xfce/thunar] 01/01: Add computer:/// to side pane (Bug #16472)

noreply at xfce.org noreply at xfce.org
Fri Feb 28 00:00:37 CET 2020


This is an automated email from the git hooks/post-receive script.

a   l   e   x       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/thunar.

commit 789fce6433bc8f8d6e11b506d8a89a853e9b3c3e
Author: Yousuf Philips <philipz85 at hotmail.com>
Date:   Thu Feb 27 20:44:35 2020 +0400

    Add computer:/// to side pane (Bug #16472)
---
 thunar/thunar-shortcuts-model.c | 19 +++++++++++++++++++
 thunar/thunar-shortcuts-model.h |  4 +++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c
index d5e92df..0c9769f 100644
--- a/thunar/thunar-shortcuts-model.c
+++ b/thunar/thunar-shortcuts-model.c
@@ -990,6 +990,7 @@ thunar_shortcuts_model_shortcut_places (ThunarShortcutsModel *model)
   ThunarShortcut *shortcut;
   GFile          *home;
   GFile          *desktop;
+  GFile          *computer;
   GFile          *trash;
   ThunarFile     *file;
 
@@ -1064,6 +1065,24 @@ thunar_shortcuts_model_shortcut_places (ThunarShortcutsModel *model)
 
   /* read the Gtk+ bookmarks file */
   model->bookmarks_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT, thunar_shortcuts_model_load, model, NULL);
+
+  /* get computer path */
+  computer = thunar_g_file_new_for_computer ();
+
+  /* add computer entry */
+  file = thunar_file_get (computer, NULL);
+  if (file != NULL)
+    {
+      shortcut = g_slice_new0 (ThunarShortcut);
+      shortcut->group = THUNAR_SHORTCUT_GROUP_PLACES_DEFAULT;
+      shortcut->name = g_strdup (_("Computer"));
+      shortcut->file = file;
+      shortcut->gicon = g_themed_icon_new ("computer");
+      shortcut->hidden = thunar_shortcuts_model_get_hidden (model, shortcut);
+      thunar_shortcuts_model_add_shortcut (model, shortcut);
+    }
+
+  g_object_unref (computer);
 }
 
 
diff --git a/thunar/thunar-shortcuts-model.h b/thunar/thunar-shortcuts-model.h
index 677e9b4..0fe21b6 100644
--- a/thunar/thunar-shortcuts-model.h
+++ b/thunar/thunar-shortcuts-model.h
@@ -63,7 +63,8 @@ typedef enum
 #define THUNAR_SHORTCUT_GROUP_PLACES  (THUNAR_SHORTCUT_GROUP_PLACES_HEADER \
                                        | THUNAR_SHORTCUT_GROUP_PLACES_DEFAULT \
                                        | THUNAR_SHORTCUT_GROUP_PLACES_TRASH \
-                                       | THUNAR_SHORTCUT_GROUP_PLACES_BOOKMARKS)
+                                       | THUNAR_SHORTCUT_GROUP_PLACES_BOOKMARKS \
+                                       | THUNAR_SHORTCUT_GROUP_PLACES_COMPUTER )
 #define THUNAR_SHORTCUT_GROUP_NETWORK (THUNAR_SHORTCUT_GROUP_NETWORK_HEADER \
                                        | THUNAR_SHORTCUT_GROUP_NETWORK_DEFAULT \
                                        | THUNAR_SHORTCUT_GROUP_NETWORK_MOUNTS)
@@ -84,6 +85,7 @@ enum _ThunarShortcutGroup
   THUNAR_SHORTCUT_GROUP_PLACES_DEFAULT     = (1 << 5),  /* home and desktop */
   THUNAR_SHORTCUT_GROUP_PLACES_TRASH       = (1 << 6),  /* trash */
   THUNAR_SHORTCUT_GROUP_PLACES_BOOKMARKS   = (1 << 7),  /* gtk-bookmarks */
+  THUNAR_SHORTCUT_GROUP_PLACES_COMPUTER    = (1 << 11), /* computer */
 
   /* THUNAR_SHORTCUT_GROUP_NETWORK */
   THUNAR_SHORTCUT_GROUP_NETWORK_HEADER     = (1 << 8),  /* network header */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list