mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-14 04:23:10 -04:00
experimental fix against early closing crash on CreateCircleDialog
This commit is contained in:
parent
04fd7f17ca
commit
5f15414e65
@ -51,7 +51,10 @@
|
||||
CreateCircleDialog::CreateCircleDialog()
|
||||
: QDialog(NULL, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
mIdentitiesLoading = false;
|
||||
mCloseAfterIdentitiesLoaded = false;
|
||||
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
@ -112,11 +115,22 @@ CreateCircleDialog::CreateCircleDialog()
|
||||
QObject::connect(ui.radioButton_Public, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||
QObject::connect(ui.radioButton_Self, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||
QObject::connect(ui.radioButton_Restricted, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||
|
||||
}
|
||||
|
||||
CreateCircleDialog::~CreateCircleDialog()
|
||||
{
|
||||
}
|
||||
void CreateCircleDialog::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
if(mIdentitiesLoading)
|
||||
{
|
||||
mCloseAfterIdentitiesLoaded = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
QDialog::closeEvent(e);
|
||||
}
|
||||
|
||||
void CreateCircleDialog::editExistingId(const RsGxsGroupId &circleId, const bool &clearList /*= true*/,bool readonly)
|
||||
{
|
||||
@ -700,6 +714,8 @@ void CreateCircleDialog::loadIdentities()
|
||||
{
|
||||
std::cerr << "Loading identities..." << std::endl;
|
||||
|
||||
mIdentitiesLoading = true;
|
||||
|
||||
RsThread::async([this]()
|
||||
{
|
||||
std::list<RsGroupMetaData> ids_meta;
|
||||
@ -735,7 +751,13 @@ void CreateCircleDialog::loadIdentities()
|
||||
fillIdentitiesList(*id_groups);
|
||||
|
||||
delete id_groups;
|
||||
}, this );
|
||||
|
||||
mIdentitiesLoading = false;
|
||||
|
||||
if(mCloseAfterIdentitiesLoaded)
|
||||
close();
|
||||
|
||||
}, this );
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,8 @@ public:
|
||||
void addCircle(const RsGxsCircleDetails &cirDetails);
|
||||
|
||||
private slots:
|
||||
void addMember();
|
||||
|
||||
void addMember();
|
||||
void removeMember();
|
||||
|
||||
void updateCircleType(bool b);
|
||||
@ -60,6 +61,9 @@ private slots:
|
||||
void IdListCustomPopupMenu( QPoint point );
|
||||
void MembershipListCustomPopupMenu( QPoint point);
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent *) override;
|
||||
|
||||
private:
|
||||
|
||||
void updateCircleGUI();
|
||||
@ -69,7 +73,9 @@ private:
|
||||
|
||||
bool mIsExistingCircle;
|
||||
bool mIsExternalCircle;
|
||||
bool mReadOnly;
|
||||
bool mReadOnly;
|
||||
bool mIdentitiesLoading;
|
||||
bool mCloseAfterIdentitiesLoaded;
|
||||
|
||||
void loadCircle(const RsGxsGroupId& groupId);
|
||||
void loadIdentities();
|
||||
|
Loading…
x
Reference in New Issue
Block a user