mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-24 15:05:35 -04:00
keep groups sorted together, and auto-expand group when adding a profile to a group
This commit is contained in:
parent
0cea0e5217
commit
886d71e59c
4 changed files with 42 additions and 135 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue