@@ -160,25 +160,22 @@ void Controller::onCardsAvailable(
160160 }
161161}
162162
163- void Controller::runCommandHandler (const std::vector<ElectronicID::ptr>& availableEids)
164- {
165- try {
166- auto * commandHandlerRunThread =
167- new CommandHandlerRunThread (this , *commandHandler, availableEids);
168- connectRetry (commandHandlerRunThread);
169-
170- // When the command handler run thread retrieves certificates successfully, call
171- // onCertificatesLoaded() that starts card event monitoring while user enters the PIN.
172- connect (commandHandler.get (), &CommandHandler::singleCertificateReady, this ,
173- &Controller::onCertificatesLoaded);
174- connect (commandHandler.get (), &CommandHandler::multipleCertificatesReady, this ,
175- &Controller::onCertificatesLoaded);
176-
177- commandHandlerRunThread->start ();
178-
179- } catch (const std::exception& error) {
180- onCriticalFailure (error.what ());
181- }
163+ void Controller::runCommandHandler (std::vector<ElectronicID::ptr> availableEids) noexcept
164+ try {
165+ auto * commandHandlerRunThread =
166+ new CommandHandlerRunThread (this , *commandHandler, std::move (availableEids));
167+ connectRetry (commandHandlerRunThread);
168+
169+ // When the command handler run thread retrieves certificates successfully, call
170+ // onCertificatesLoaded() that starts card event monitoring while user enters the PIN.
171+ connect (commandHandler.get (), &CommandHandler::singleCertificateReady, this ,
172+ &Controller::onCertificatesLoaded);
173+ connect (commandHandler.get (), &CommandHandler::multipleCertificatesReady, this ,
174+ &Controller::onCertificatesLoaded);
175+
176+ commandHandlerRunThread->start ();
177+ } catch (const std::exception& error) {
178+ onCriticalFailure (error.what ());
182179}
183180
184181void Controller::onCertificatesLoaded ()
@@ -202,22 +199,22 @@ void Controller::disposeUI()
202199 }
203200}
204201
205- void Controller::onConfirmCommandHandler (const EidCertificateAndPinInfo& certAndPinInfo)
206- {
202+ void Controller::onConfirmCommandHandler (const EidCertificateAndPinInfo& certAndPinInfo) noexcept
203+ try {
207204 emit stopCardEventMonitorThread ();
208205
209- try {
210- auto * commandHandlerConfirmThread =
211- new CommandHandlerConfirmThread (this , *commandHandler, window, certAndPinInfo);
212- connect (commandHandlerConfirmThread, &CommandHandlerConfirmThread::completed, this ,
213- &Controller::onCommandHandlerConfirmCompleted);
214- connectRetry (commandHandlerConfirmThread);
206+ auto * commandHandlerConfirmThread =
207+ new CommandHandlerConfirmThread (this , *commandHandler, window, certAndPinInfo);
208+ connect (commandHandlerConfirmThread, &CommandHandlerConfirmThread::completed, this ,
209+ &Controller::onCommandHandlerConfirmCompleted);
210+ connectRetry (commandHandlerConfirmThread);
211+ connect (commandHandler.get (), &CommandHandler::verifyPinFailed, this ,
212+ &Controller::onCertificatesLoaded);
215213
216- commandHandlerConfirmThread->start ();
214+ commandHandlerConfirmThread->start ();
217215
218- } catch (const std::exception& error) {
219- onCriticalFailure (error.what ());
220- }
216+ } catch (const std::exception& error) {
217+ onCriticalFailure (error.what ());
221218}
222219
223220void Controller::onCommandHandlerConfirmCompleted (const QVariantMap& res)
@@ -258,7 +255,7 @@ void Controller::onRetry()
258255 }
259256}
260257
261- void Controller::connectRetry (const ControllerChildThread* childThread)
258+ void Controller::connectRetry (const ControllerChildThread* childThread) const
262259{
263260 REQUIRE_NON_NULL (childThread)
264261 connect (childThread, &ControllerChildThread::failure, this , &Controller::onCriticalFailure);
0 commit comments