[Xfce4-commits] [xfce/thunar] 01/01: Add new bookmarks to bottom of list in shortcuts view (Bug #16526)

noreply at xfce.org noreply at xfce.org
Thu Mar 12 00:25:53 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 99d6d6c7a61dfae4e5d48f5b7599e61d46286953
Author: Theo Linkspfeifer <lastonestanding at tutanota.com>
Date:   Wed Mar 11 12:56:26 2020 +0100

    Add new bookmarks to bottom of list in shortcuts view (Bug #16526)
---
 thunar/thunar-shortcuts-model.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c
index 6a98e9a..9e954d2 100644
--- a/thunar/thunar-shortcuts-model.c
+++ b/thunar/thunar-shortcuts-model.c
@@ -1960,6 +1960,8 @@ thunar_shortcuts_model_add (ThunarShortcutsModel *model,
 {
   ThunarShortcut *shortcut;
   GFile          *location;
+  GList          *lp;
+  guint           position = 0;
 
   _thunar_return_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model));
   _thunar_return_if_fail (dst_path == NULL || gtk_tree_path_get_depth (dst_path) > 0);
@@ -1987,6 +1989,16 @@ thunar_shortcuts_model_add (ThunarShortcutsModel *model,
       shortcut->gicon = g_themed_icon_new ("folder-remote");
     }
 
+  /* if no position was given, place the shortcut at the bottom */
+  if (dst_path == NULL)
+    {
+      for (lp = model->shortcuts; lp != NULL; lp = lp->next)
+        if (THUNAR_SHORTCUT (lp->data)->group == THUNAR_SHORTCUT_GROUP_PLACES_BOOKMARKS)
+          position++;
+
+      shortcut->sort_id = ++position;
+    }
+
   /* add the shortcut to the list at the given position */
   thunar_shortcuts_model_add_shortcut_with_path (model, shortcut, dst_path);
 

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


More information about the Xfce4-commits mailing list