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 authored and mrts committed Feb 6, 2025
1 parent 632830c commit 9fd7a8b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/ui/webeiddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ void WebEidDialog::onVerifyPinFailed(const VerifyPinFailed::Status status, const
break;
case Status::UNKNOWN_ERROR:
message = [] { return tr("Technical error"); };
displayFatalError(message);
displayFatalError(std::move(message));
return;
}

Expand Down Expand Up @@ -682,14 +682,15 @@ void WebEidDialog::displayPinBlockedError()
displayFatalError([] { return tr("PIN is locked. Unblock and try again."); });
}

void WebEidDialog::displayFatalError(std::function<QString()> message)
template <typename Text>
void WebEidDialog::displayFatalError(Text message)
{
ui->pinTitleLabel->hide();
ui->pinInput->hide();
ui->pinTimeoutTimer->stop();
ui->pinTimeRemaining->hide();
ui->pinEntryTimeoutProgressBar->hide();
setTrText(ui->pinErrorLabel, message);
setTrText(ui->pinErrorLabel, std::forward<Text>(message));
ui->pinErrorLabel->show();
ui->okButton->hide();
ui->cancelButton->setEnabled(true);
Expand Down
3 changes: 2 additions & 1 deletion src/ui/webeiddialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ class WebEidDialog final : public WebEidUI
template <typename Func>
void setupOK(Func func, const char* text = {}, bool enabled = false);
void displayPinBlockedError();
void displayFatalError(std::function<QString()> message);
template <typename Text>
void displayFatalError(Text message);

void showPinInputWarning(bool show);
void resizeHeight();
Expand Down

0 comments on commit 9fd7a8b

Please sign in to comment.