New sorting option - #819
Conversation
|
(i) The patch feels "incomplete" as it would leave nested folder names unsorted. As a consistent sorting order would really matter only to those with many configs, this is not a minor defect. (ii) While the argument about immutability of That said, is this complication worth it --- I have never seen NTFS return file list in non alphabetcial order. What fraction of users are affected? |
Right, keeping the prestarted profiles at the top as we have now is important. Also global and local config folders ordered the same way as now. So, it may be better not to touch folder ordering at all.
A very special use-case... |
|
No problem at all, I completely understand. No rush on the review whatsoever - take your time. If it eventually lands, great, since IMHO it's a genuinely useful improvement for anyone whose config folder doesn't enumerate in a predictable order. Thanks again for taking the time to look at it! |

Summary
VPN profiles are listed in the tray menu in the order returned by the
filesystem (
FindFirstFile/FindNextFile). On NTFS this is usuallyalphabetical, but it is not guaranteed - FAT/exFAT and network shares can
return creation order - and there was no explicit sorting anywhere.
This PR adds an opt-in setting to sort configurations alphabetically in the
menu, controlled by a new checkbox in General → Preferences. The option is
off by default, so existing behavior is unchanged unless the user enables it.
Behavior notes
RecreatePopupMenus→BuildFileList→CreatePopupMenus), so toggling the checkbox takes effect immediately on thenext menu open - no restart required.
config keeps its immutable
c->id(assigned at load time).c->idis never modified, so the management port mapping(
mgmt_port_offset + id) and the per-config menu handles (hMenuConn[id])remain intact.
configs within each folder are sorted while the order of the folders
themselves is left unchanged.