From e5273fb88742c3f2edbd80b7d061d00f2693a0cb Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 29 Apr 2025 21:10:27 +0200 Subject: [PATCH] fixed wrong implementation of parentRow causing loss of selected elements --- retroshare-gui/src/gui/common/FriendListModel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index 9ea271f86..45c054698 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -304,10 +304,10 @@ uint32_t RsFriendListModel::EntryIndex::parentRow(uint32_t nb_groups) const switch(type) { default: - case ENTRY_TYPE_UNKNOWN : return 0; - case ENTRY_TYPE_GROUP : return group_index; - case ENTRY_TYPE_PROFILE : return (group_index==UNDEFINED_GROUP_INDEX_VALUE)?(profile_index+nb_groups):profile_index; - case ENTRY_TYPE_NODE : return node_index; + case ENTRY_TYPE_UNKNOWN : return -1; + case ENTRY_TYPE_GROUP : return -1; + case ENTRY_TYPE_PROFILE : return (group_index==UNDEFINED_GROUP_INDEX_VALUE)?(-1):group_index; + case ENTRY_TYPE_NODE : return (group_index==UNDEFINED_GROUP_INDEX_VALUE)?(profile_index+nb_groups):profile_index; } }