mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 08:59:50 -05:00
fixed two bugs in Create/Edit circle dialog, causing crashes
This commit is contained in:
parent
b784b6a3e8
commit
b4d2904adf
@ -584,12 +584,13 @@ void CreateCircleDialog::createCircle()
|
|||||||
circle.mMeta.mCircleType = GXS_CIRCLE_TYPE_LOCAL;
|
circle.mMeta.mCircleType = GXS_CIRCLE_TYPE_LOCAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_existing_circle(mIsExistingCircle);
|
||||||
|
|
||||||
RsThread::async([&circle,this]()
|
RsThread::async([circle,is_existing_circle]()
|
||||||
{
|
{
|
||||||
RsGxsCircleId circleId;
|
RsGxsCircleId circleId;
|
||||||
|
|
||||||
if(mIsExistingCircle)
|
if(is_existing_circle)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
||||||
std::cerr << "CreateCircleDialog::updateCircle() : mCircleType: " << circle.mMeta.mCircleType << std::endl;
|
std::cerr << "CreateCircleDialog::updateCircle() : mCircleType: " << circle.mMeta.mCircleType << std::endl;
|
||||||
@ -598,7 +599,7 @@ void CreateCircleDialog::createCircle()
|
|||||||
|
|
||||||
std::cerr << "CreateCircleDialog::updateCircle() Checks and Balances Okay - calling service proper.."<< std::endl;
|
std::cerr << "CreateCircleDialog::updateCircle() Checks and Balances Okay - calling service proper.."<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
rsGxsCircles->editCircle(circle);
|
rsGxsCircles->editCircle(*const_cast<RsGxsCircleGroup*>(&circle)); // const_cast: Not nice, but simpler.
|
||||||
|
|
||||||
circleId = RsGxsCircleId(circle.mMeta.mGroupId);
|
circleId = RsGxsCircleId(circle.mMeta.mGroupId);
|
||||||
}
|
}
|
||||||
@ -619,9 +620,9 @@ void CreateCircleDialog::createCircle()
|
|||||||
circle.mLocalFriends);
|
circle.mLocalFriends);
|
||||||
}
|
}
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [this,circle,circleId]()
|
if(!is_existing_circle)
|
||||||
|
RsQThreadUtils::postToObject( [circle,circleId]()
|
||||||
{
|
{
|
||||||
if(!mIsExistingCircle)
|
|
||||||
QMessageBox::information(nullptr,tr("Circle created"),
|
QMessageBox::information(nullptr,tr("Circle created"),
|
||||||
tr("Your new circle has been created:\n Name: %1\n Id: %2.")
|
tr("Your new circle has been created:\n Name: %1\n Id: %2.")
|
||||||
.arg(QString::fromUtf8(circle.mMeta.mGroupName.c_str()))
|
.arg(QString::fromUtf8(circle.mMeta.mGroupName.c_str()))
|
||||||
|
Loading…
Reference in New Issue
Block a user