comparison ui/certificatelistwidget.cpp @ 757:9bfaced5cf59

(issue56) Do not delete the certificate immediately When the selection changed the remove cert is triggered by a slection change event in the certificateitem. Deleting it immediately would delete the trigger of the call. Instead we deleteLater so that the widget get's cleaned up in the next mainloop iteration when it is no longer needed.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 07 Jul 2014 12:54:02 +0200
parents a467204a35f5
children bd33c6585cd0
comparison
equal deleted inserted replaced
756:e93bbcf70a12 757:9bfaced5cf59
41 void CertificateListWidget::removeCertificate(const Certificate &cert) 41 void CertificateListWidget::removeCertificate(const Certificate &cert)
42 { 42 {
43 for (int i = 0; i < mCertificateWidgets.size(); i++) { 43 for (int i = 0; i < mCertificateWidgets.size(); i++) {
44 if (mCertificateWidgets[i]->certificate() == cert) { 44 if (mCertificateWidgets[i]->certificate() == cert) {
45 mLayout.removeWidget(mCertificateWidgets[i]); 45 mLayout.removeWidget(mCertificateWidgets[i]);
46 delete(mCertificateWidgets[i]); 46 mCertificateWidgets[i]->deleteLater();
47 mCertificateWidgets.removeAt(i); 47 mCertificateWidgets.removeAt(i);
48 break; 48 break;
49 } 49 }
50 } 50 }
51 emit certListChanged(-1); 51 emit certListChanged(-1);

http://wald.intevation.org/projects/trustbridge/