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 97420d160ab845cc8852b2e63e1de4b971d3b1d9 Author: Theo Linkspfeifer <lastonestand...@tutanota.com> Date: Fri Feb 28 11:40:04 2020 +0100 Sort device entries in tree view (Bug #16471) --- thunar/thunar-tree-model.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/thunar/thunar-tree-model.c b/thunar/thunar-tree-model.c index 32bcc0d..17d9bf5 100644 --- a/thunar/thunar-tree-model.c +++ b/thunar/thunar-tree-model.c @@ -1075,12 +1075,26 @@ thunar_tree_model_device_added (ThunarDeviceMonitor *device_monitor, _thunar_return_if_fail (THUNAR_IS_DEVICE (device)); _thunar_return_if_fail (THUNAR_IS_TREE_MODEL (model)); + /* lookup the last child of the root (the "File System" node) */ + node = g_node_last_child (model->root); + + /* determine the position for the new node in the item list */ + for (node = node->prev; node != NULL; node = node->prev) + { + item = THUNAR_TREE_MODEL_ITEM (node->data); + if (item->device == NULL) + break; + + /* sort devices by timestamp */ + if (thunar_device_sort (item->device, device) < 0) + break; + } + /* allocate a new item for the volume */ item = thunar_tree_model_item_new_with_device (model, device); - /* insert before the last child of the root (the "File System" node) */ - node = g_node_last_child (model->root); - node = g_node_insert_data_before (model->root, node, item); + /* insert the new node */ + node = g_node_insert_data_after (model->root, node, item); /* determine the iterator for the new node */ GTK_TREE_ITER_INIT (iter, model->stamp, node); -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits