Skip to content

Commit

Permalink
Fix coverity errors
Browse files Browse the repository at this point in the history
WE2-1003

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma committed Aug 7, 2024
1 parent e42c67e commit a057c90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/libelectronic-id
17 changes: 8 additions & 9 deletions src/ui/webeiddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,12 @@ void WebEidDialog::onMultipleCertificatesReady(
case CommandType::AUTHENTICATE:
ui->selectAnotherCertificate->disconnect();
ui->selectAnotherCertificate->setVisible(certificateAndPinInfos.size() > 1);
connect(ui->selectAnotherCertificate, &QPushButton::clicked, this,
[this, origin, certificateAndPinInfos] {
// We set pinInput to empty text instead of clear() to also reset undo buffer
ui->pinInput->setText({});
onMultipleCertificatesReady(origin, certificateAndPinInfos);
});
setupOK([this, origin] {
connect(ui->selectAnotherCertificate, &QPushButton::clicked, this, [=] {
// We set pinInput to empty text instead of clear() to also reset undo buffer
ui->pinInput->setText({});
onMultipleCertificatesReady(origin, certificateAndPinInfos);
});
setupOK([=] {
ui->okButton->setDisabled(true);
// Authenticate continues with the selected certificate to onSingleCertificateReady().
if (auto* button =
Expand Down Expand Up @@ -382,7 +381,7 @@ void WebEidDialog::onSingleCertificateReady(const QUrl& origin,
switch (currentCommand) {
case CommandType::GET_SIGNING_CERTIFICATE:
setupCertificateAndPinInfo({certAndPin});
setupOK([this, certAndPin] {
setupOK([=] {
ui->okButton->setDisabled(true);
emit accepted(certAndPin);
});
Expand Down Expand Up @@ -556,7 +555,7 @@ void WebEidDialog::setTrText(QWidget* label, Text text) const
void WebEidDialog::connectOkToCachePinAndEmitSelectedCertificate(
const CardCertificateAndPinInfo& certAndPin)
{
setupOK([this, certAndPin] {
setupOK([=] {
ui->pinInput->hide();
ui->pinTitleLabel->hide();
ui->pinErrorLabel->hide();
Expand Down

0 comments on commit a057c90

Please sign in to comment.