replaced the few bools in RsIdentityDetail by a set of flags

This commit is contained in:
csoler 2015-11-19 21:14:32 -05:00
parent 738dadadc9
commit 1de55d8fc5
9 changed files with 32 additions and 33 deletions

View file

@ -235,7 +235,7 @@ static bool trimAnonIds(std::list<RsGxsId>& lst)
RsIdentityDetails idd ;
for(std::list<RsGxsId>::iterator it = lst.begin();it!=lst.end();)
if(!rsIdentity->getIdDetails(*it,idd) || !idd.mPgpLinked)
if(!rsIdentity->getIdDetails(*it,idd) || !(idd.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED))
{
it = lst.erase(it) ;
removed= true ;

View file

@ -1333,7 +1333,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
if(!gxs_id.isNull() && rsIdentity->getIdDetails(gxs_id,gxs_details))
{
if(gxs_details.mIsOwnId)
if(gxs_details.mFlags & RS_IDENTITY_FLAGS_IS_OWN_ID)
{
QMessageBox::warning(NULL,QString("Cannot send message to yourself"),QString("This identity is owned by you. You wouldn't want to send yourself a message right?"));
break ;

View file

@ -110,7 +110,7 @@ void CreateLobbyDialog::checkTextFields()
rsIdentity->getIdDetails(id,idd) ;
if( (!idd.mPgpKnown) && ui->pgp_signed_CB->isChecked())
if( (!(idd.mFlags & RS_IDENTITY_FLAGS_PGP_KNOWN)) && ui->pgp_signed_CB->isChecked())
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false) ;
}

View file

@ -895,11 +895,11 @@ QString nickname = details.mNickname.empty()?tr("[Unknown]"):QString::fromUtf8(d
QApplication::translate("GxsIdDetails", "Identity&nbsp;Id"),
QString::fromStdString(details.mId.toStdString()));
if (details.mPgpLinked)
if (details.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED)
{
comment += QString("<br/>%1:%2 ").arg(QApplication::translate("GxsIdDetails", "Authentication"), QApplication::translate("GxsIdDetails", "Signed&nbsp;by"));
if (details.mPgpKnown)
if (details.mFlags & RS_IDENTITY_FLAGS_PGP_KNOWN)
{
/* look up real name */
std::string authorName = rsPeers->getGPGName(details.mPgpId);
@ -937,9 +937,9 @@ void GxsIdDetails::getIcons(const RsIdentityDetails &details, QList<QIcon> &icon
{
// ICON Logic.
QIcon baseIcon;
if (details.mPgpLinked)
if (details.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED)
{
if (details.mPgpKnown)
if (details.mFlags & RS_IDENTITY_FLAGS_PGP_KNOWN)
baseIcon = QIcon(IMAGE_PGPKNOWN);
else
baseIcon = QIcon(IMAGE_PGPUNKNOWN);