keep groups sorted together, and auto-expand group when adding a profile to a group

This commit is contained in:
csoler 2019-08-26 18:27:20 +02:00
parent 0cea0e5217
commit 886d71e59c
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
4 changed files with 42 additions and 135 deletions

View file

@ -391,14 +391,11 @@ QVariant RsFriendListModel::data(const QModelIndex &index, int role) const
case FilterRole: return filterRole(entry,index.column()) ;
case SortRole: return sortRole(entry,index.column()) ;
case OnlineRole: return onlineRole(entry,index.column()) ;
case TypeRole: return QVariant((int)entry.type);
default:
return QVariant();
}
// case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ;
// case Qt::UserRole: return userRole (fmpe,index.column()) ;
//
}
QVariant RsFriendListModel::textColorRole(const EntryIndex& fmpe,int column) const
@ -1117,4 +1114,14 @@ void RsFriendListModel::updateInternalData()
mLastInternalDataUpdate = time(NULL);
}
QModelIndex RsFriendListModel::getIndexOfGroup(const RsNodeGroupId& mid) const
{
if(mDisplayGroups)
for(uint32_t i=0;i<mGroups.size();++i)
if(mGroups[i].group_info.id == mid)
return index(i,0,QModelIndex());
return QModelIndex();
}