In order to unify the location of Network in shortcut and tree views, the position of it in tree view should be moved to the bottom and any connected network shares should appear below it.
agreed, that would be nice to have !
Created attachment 9562 patch
this patch works, but then network shares are still appearing above devices https://imgur.com/uSQ1kP9.png
Created attachment 9600 experimental diff
patch worked for me. https://imgur.com/80WsGGm.png
same as in shortcut view https://imgur.com/pZhll0t.png
Works fine here, thanks ! > if (thunar_device_sort (item->device, device) > 0) You switched from "lesss than" to "greater than" for a special reason ? for (node2 = node->next; node2 != NULL; node2 = node2->next) { item = THUNAR_TREE_MODEL_ITEM (node2->data); if (item->device == NULL) break; /* sort devices by timestamp */ if (thunar_device_sort (item->device, device) > 0) break; node = node2; } Think that loop can be done with only one "node" variable: /* determine the position for the new node in the item list */ for (;node->next != NULL; node = node->next) { 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; } ... or do I miss something ?
> You switched from "lesss than" to "greater than" for a special reason ? The loop now goes in the other direction (node = node->next). > Think that loop can be done with only one "node" variable: That was my initial plan, but there were corner cases. When a volume is added to the list, the loop will break after finding the Network node (item->device == NULL). Therefore, the new entry will be added below the Network one -> wrong.
(In reply to Theo Linkspfeifer from comment #8) > > You switched from "lesss than" to "greater than" for a special reason ? > The loop now goes in the other direction (node = node->next). Uh, I somehow failed toseee that there was "->prev" before > > Think that loop can be done with only one "node" variable: > That was my initial plan, but there were corner cases. When a volume is > added to the list, the loop will break after finding the Network node > (item->device == NULL). Therefore, the new entry will be added below the > Network one -> wrong. I see ... though I at least would rename "node2" to something like "node_iter". Besides that, I think it is good to get pushed.
Created attachment 9619 diff Actually, the following change was missing in your suggestion: item = THUNAR_TREE_MODEL_ITEM (node->next->data);
Nice ! Haha, looks like I gave up to early by the word "corner cases" ;) Seems to work fine ... good to get pushed ?
Sure.
Theo Linkspfeifer referenced this bugreport in commit b7129722f881e6d9b190e28323773882f22fdf04 Move 'network' to the bottom of tree view (Bug #16516) https://git.xfce.org/xfce/thunar/commit?id=b7129722f881e6d9b190e28323773882f22fdf04
ok, pushed to master. Thanks alot for your effort !