Making sure Verification Objects are deleted properly

This commit is contained in:
Chethan2k1 2020-09-10 13:25:49 +05:30
parent e70b4e4268
commit a27662dc08
3 changed files with 19 additions and 14 deletions

View file

@ -82,9 +82,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter
}
onClicked: {
dialog.close();
deviceVerificationList.remove(tran_id);
delete flow;
flow.deleteFlow();
dialog.destroy();
}
}
Item {
@ -141,9 +141,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter
}
onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.User);
deviceVerificationList.remove(tran_id);
dialog.destroy();
}
}
Item {
@ -205,9 +205,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter
}
onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.User);
deviceVerificationList.remove(tran_id);
dialog.destroy();
}
}
Item {
@ -267,9 +267,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter
}
onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.MismatchedSAS);
deviceVerificationList.remove(tran_id);
dialog.destroy();
}
}
Item {
@ -426,9 +426,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter
}
onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.MismatchedSAS);
deviceVerificationList.remove(tran_id);
dialog.destroy();
}
}
Item {
@ -487,9 +487,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter
}
onClicked: {
dialog.close();
flow.cancelVerification(DeviceVerificationFlow.User);
deviceVerificationList.remove(tran_id);
dialog.destroy();
}
}
Item {
@ -534,9 +534,9 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter
}
onClicked: {
dialog.close()
deviceVerificationList.remove(tran_id);
delete flow;
flow.deleteFlow();
dialog.destroy();
}
}
}
@ -578,8 +578,8 @@ ApplicationWindow {
verticalAlignment: Text.AlignVCenter
}
onClicked: {
dialog.close();
deviceVerificationList.remove(tran_id);
dialog.destroy();
}
}
}
@ -622,9 +622,9 @@ ApplicationWindow {
}
text: qsTr("Close")
onClicked: {
dialog.close()
deviceVerificationList.remove(tran_id);
delete flow;
flow.deleteFlow();
dialog.destroy()
}
}
}

View file

@ -41,6 +41,10 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
this->deleteLater();
});
connect(this,&DeviceVerificationFlow::deleteFlow,this,[this](){
this->deleteLater();
});
connect(
ChatPage::instance(),
&ChatPage::recievedDeviceVerificationStart,

View file

@ -105,6 +105,7 @@ signals:
void timedout();
void verificationCanceled();
void refreshProfile();
void deleteFlow();
private:
// general