From 0396fdb01d12e51bd2cc63478819b366c0453d29 Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Sat, 6 Mar 2021 20:26:21 +0100 Subject: Moves all globals into a structure that can be deleted before the app exists. Fixes #193. --- src/dialogs/certificateselectiondialog.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/dialogs/certificateselectiondialog.cpp') diff --git a/src/dialogs/certificateselectiondialog.cpp b/src/dialogs/certificateselectiondialog.cpp index 2c08110..4d7d5ff 100644 --- a/src/dialogs/certificateselectiondialog.cpp +++ b/src/dialogs/certificateselectiondialog.cpp @@ -16,7 +16,7 @@ CertificateSelectionDialog::CertificateSelectionDialog(QWidget *parent) : ui->setupUi(this); this->ui->server_request->setVisible(false); - this->ui->certificates->setModel(&kristall::identities); + this->ui->certificates->setModel(&kristall::globals().identities); this->ui->certificates->expandAll(); connect(this->ui->certificates->selectionModel(), &QItemSelectionModel::currentChanged, this, &CertificateSelectionDialog::on_currentChanged); @@ -86,7 +86,7 @@ void CertificateSelectionDialog::on_currentChanged(const QModelIndex ¤t, c { Q_UNUSED(current) Q_UNUSED(previous) - auto id = kristall::identities.getIdentity(current); + auto id = kristall::globals().identities.getIdentity(current); this->ui->use_selected_cert->setEnabled(id.isValid()); } @@ -103,7 +103,7 @@ void CertificateSelectionDialog::on_create_new_cert_clicked() return; id.is_persistent = true; - kristall::identities.addCertificate( + kristall::globals().identities.addCertificate( dialog.groupName(), id); } @@ -111,7 +111,7 @@ void CertificateSelectionDialog::on_create_new_cert_clicked() void CertificateSelectionDialog::on_use_selected_cert_clicked() { auto sel = this->ui->certificates->selectionModel()->currentIndex(); - this->cryto_identity = kristall::identities.getIdentity(sel); + this->cryto_identity = kristall::globals().identities.getIdentity(sel); if(this->cryto_identity.isValid()) { this->accept(); } else { @@ -121,7 +121,7 @@ void CertificateSelectionDialog::on_use_selected_cert_clicked() void CertificateSelectionDialog::on_certificates_doubleClicked(const QModelIndex &index) { - this->cryto_identity = kristall::identities.getIdentity(index); + this->cryto_identity = kristall::globals().identities.getIdentity(index); if(this->cryto_identity.isValid()) { this->accept(); } else { -- cgit v1.2.3