mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
small code cleaning bits
This commit is contained in:
parent
3d45947e5b
commit
083dc626da
1 changed files with 20 additions and 21 deletions
|
@ -551,8 +551,8 @@ void CreateCircleDialog::updateCircleGUI()
|
||||||
ui.radioButton_Self->setChecked(false);
|
ui.radioButton_Self->setChecked(false);
|
||||||
ui.radioButton_Restricted->setChecked(false);
|
ui.radioButton_Restricted->setChecked(false);
|
||||||
|
|
||||||
switch(mCircleGroup.mMeta.mCircleType) {
|
switch(mCircleGroup.mMeta.mCircleType)
|
||||||
#ifdef RS_ALLOW_LOCAL_CIRCLES
|
{
|
||||||
case GXS_CIRCLE_TYPE_LOCAL:
|
case GXS_CIRCLE_TYPE_LOCAL:
|
||||||
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
||||||
std::cerr << "CreateCircleDialog::updateCircleGUI() : LOCAL CIRCLETYPE";
|
std::cerr << "CreateCircleDialog::updateCircleGUI() : LOCAL CIRCLETYPE";
|
||||||
|
@ -561,7 +561,6 @@ void CreateCircleDialog::updateCircleGUI()
|
||||||
|
|
||||||
isExternal = false;
|
isExternal = false;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case GXS_CIRCLE_TYPE_PUBLIC:
|
case GXS_CIRCLE_TYPE_PUBLIC:
|
||||||
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
||||||
|
@ -594,17 +593,16 @@ void CreateCircleDialog::updateCircleGUI()
|
||||||
default:
|
default:
|
||||||
std::cerr << "CreateCircleDialog::updateCircleGUI() INVALID mCircleType";
|
std::cerr << "CreateCircleDialog::updateCircleGUI() INVALID mCircleType";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
}//switch(mCircleGroup.mMeta.mCircleType)
|
}
|
||||||
|
|
||||||
// set preferredId.
|
// set preferredId.
|
||||||
ui.idChooser->loadIds(0,mCircleGroup.mMeta.mAuthorId);
|
ui.idChooser->loadIds(0,mCircleGroup.mMeta.mAuthorId);
|
||||||
|
|
||||||
/* setup personal or external circle */
|
/* setup personal or external circle */
|
||||||
if (isExternal) {
|
if (isExternal)
|
||||||
setupForExternalCircle();
|
setupForExternalCircle();
|
||||||
} else {//if (isExternal)
|
else
|
||||||
setupForPersonalCircle();
|
setupForPersonalCircle();
|
||||||
}//else (isExternal)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateCircleDialog::requestCircle(const RsGxsGroupId &groupId)
|
void CreateCircleDialog::requestCircle(const RsGxsGroupId &groupId)
|
||||||
|
@ -729,7 +727,7 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
|
||||||
std::cerr << "CreateCircleDialog::insertIdentities() Error getting GroupData";
|
std::cerr << "CreateCircleDialog::insertIdentities() Error getting GroupData";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}//if (!rsIdentity->getGroupData(token, datavector))
|
}
|
||||||
|
|
||||||
for(vit = datavector.begin(); vit != datavector.end(); ++vit)
|
for(vit = datavector.begin(); vit != datavector.end(); ++vit)
|
||||||
{
|
{
|
||||||
|
@ -737,13 +735,12 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
|
||||||
|
|
||||||
/* do filtering */
|
/* do filtering */
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
if (acceptAnonymous) {
|
if (acceptAnonymous)
|
||||||
ok = true;
|
ok = true;
|
||||||
} else if (acceptAllPGP) {
|
else if (acceptAllPGP)
|
||||||
ok = data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID ;
|
ok = data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID ;
|
||||||
} else if (data.mPgpKnown) {
|
else if (data.mPgpKnown)
|
||||||
ok = data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID ;
|
ok = data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID ;
|
||||||
}//else if (data.mPgpKnown)
|
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
||||||
|
@ -751,7 +748,7 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}//if (!ok)
|
}
|
||||||
|
|
||||||
QString keyId = QString::fromStdString(data.mMeta.mGroupId.toStdString());
|
QString keyId = QString::fromStdString(data.mMeta.mGroupId.toStdString());
|
||||||
QString nickname = QString::fromUtf8(data.mMeta.mGroupName.c_str());
|
QString nickname = QString::fromUtf8(data.mMeta.mGroupName.c_str());
|
||||||
|
@ -762,15 +759,17 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
|
||||||
if(data.mImage.mSize == 0 || !pixmap.loadFromData(data.mImage.mData, data.mImage.mSize, "PNG"))
|
if(data.mImage.mSize == 0 || !pixmap.loadFromData(data.mImage.mData, data.mImage.mSize, "PNG"))
|
||||||
pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(data.mMeta.mGroupId))) ;
|
pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(data.mMeta.mGroupId))) ;
|
||||||
|
|
||||||
if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID) {
|
if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||||
|
{
|
||||||
if (data.mPgpKnown) {
|
if (data.mPgpKnown) {
|
||||||
RsPeerDetails details;
|
RsPeerDetails details;
|
||||||
rsPeers->getGPGDetails(data.mPgpId, details);
|
rsPeers->getGPGDetails(data.mPgpId, details);
|
||||||
idtype = QString::fromUtf8(details.name.c_str());
|
idtype = QString::fromUtf8(details.name.c_str());
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
idtype = tr("PGP Linked Id");
|
idtype = tr("PGP Linked Id");
|
||||||
}//else (data.mPgpKnown)
|
|
||||||
}//if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
}
|
||||||
|
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem();
|
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||||
item->setText(RSCIRCLEID_COL_NICKNAME, nickname);
|
item->setText(RSCIRCLEID_COL_NICKNAME, nickname);
|
||||||
|
@ -810,8 +809,8 @@ void CreateCircleDialog::loadRequest(const TokenQueue *queue, const TokenRequest
|
||||||
default:
|
default:
|
||||||
std::cerr << "CreateCircleDialog::loadRequest() UNKNOWN UserType ";
|
std::cerr << "CreateCircleDialog::loadRequest() UNKNOWN UserType ";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
}//switch(req.mUserType)
|
}
|
||||||
}//if (queue == mCircleQueue)
|
}
|
||||||
|
|
||||||
if (queue == mIdQueue) {
|
if (queue == mIdQueue) {
|
||||||
/* now switch on req */
|
/* now switch on req */
|
||||||
|
@ -823,8 +822,8 @@ void CreateCircleDialog::loadRequest(const TokenQueue *queue, const TokenRequest
|
||||||
default:
|
default:
|
||||||
std::cerr << "CreateCircleDialog::loadRequest() UNKNOWN UserType ";
|
std::cerr << "CreateCircleDialog::loadRequest() UNKNOWN UserType ";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
}//switch(req.mUserType)
|
}
|
||||||
}//if (queue == mIdQueue)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateCircleDialog::idTypeChanged()
|
void CreateCircleDialog::idTypeChanged()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue