From 11fb0bacc8a1355654cce5a04e123f03a6b07307 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 5 Dec 2015 17:25:55 -0500 Subject: [PATCH] fixed missing code in previous merge --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 26 ++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 3bb5a69b3..a834ab22f 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -81,6 +81,13 @@ IdDialog::IdDialog(QWidget *parent) : ui->setupUi(this); mIdQueue = NULL; + + contactsItem = new QTreeWidgetItem(); + contactsItem->setText(0, tr("Contacts")); + + allItem = new QTreeWidgetItem(); + allItem->setText(0, tr("All")); + /* Setup UI helper */ mStateHelper = new UIStateHelper(this); @@ -449,12 +456,6 @@ void IdDialog::insertIdList(uint32_t token) int accept = ui->filterComboBox->itemData(ui->filterComboBox->currentIndex()).toInt(); - contactsItem = new QTreeWidgetItem(); - contactsItem->setText(0, tr("Contacts")); - - allItem = new QTreeWidgetItem(); - allItem->setText(0, tr("All")); - RsGxsIdGroup data; std::vector datavector; std::vector::iterator vit; @@ -511,9 +512,20 @@ void IdDialog::insertIdList(uint32_t token) ui->idTreeWidget->insertTopLevelItem(0, allItem); if (fillIdListItem(*vit, item, ownPgpId, accept)) + { + RsIdentityDetails details; + std::string keyId = item->text(RSID_COL_KEYID).toStdString(); + rsIdentity->getIdDetails(RsGxsId(keyId), details); + + if(details.mFlags & RS_IDENTITY_FLAGS_IS_A_CONTACT) { - ui->idTreeWidget->addTopLevelItem(item); + contactsItem->addChild(item); } + else + { + allItem->addChild(item); + } + } } /* count items */