mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-30 01:38:51 -04:00
fixed bug in circle chooser that showed duplicates. Removed mCircleExternalIdList (not really useful now that circles are cached) and used a std::set to ensure uniqueness
This commit is contained in:
parent
af76cf028c
commit
dbd6477acd
4 changed files with 12 additions and 140 deletions
|
@ -63,7 +63,7 @@ bool MakeGxsCircleDesc(const RsGxsCircleId &id, QString &desc)
|
|||
|
||||
void GxsCircleChooser::loadGxsCircles()
|
||||
{
|
||||
std::list<RsGxsCircleId> ids;
|
||||
std::set<RsGxsCircleId> ids;
|
||||
rsGxsCircles->getCircleExternalIdList(ids);
|
||||
|
||||
if (ids.empty())
|
||||
|
@ -73,10 +73,9 @@ void GxsCircleChooser::loadGxsCircles()
|
|||
return;
|
||||
}
|
||||
|
||||
std::list<RsGxsCircleId>::iterator it;
|
||||
int i = 0;
|
||||
int def = -1;
|
||||
for(it = ids.begin(); it != ids.end(); ++it, ++i)
|
||||
for(auto it(ids.begin()); it != ids.end(); ++it, ++i)
|
||||
{
|
||||
/* add to Chooser */
|
||||
QString str;
|
||||
|
@ -91,15 +90,11 @@ void GxsCircleChooser::loadGxsCircles()
|
|||
addItem(str, id);
|
||||
|
||||
if (mDefaultCircleId == *it)
|
||||
{
|
||||
def = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (def >= 0)
|
||||
{
|
||||
setCurrentIndex(def);
|
||||
}
|
||||
}
|
||||
|
||||
bool GxsCircleChooser::getChosenCircle(RsGxsCircleId &id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue