From 440cbbb12021219d088d9998966cc5e789281387 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 26 May 2026 10:43:58 +0300 Subject: [PATCH] Fix crash on --help parameter display WE2-1221 Signed-off-by: Raul Metsma --- src/controller/application.cpp | 1 - src/controller/controller.cpp | 6 ++++++ src/controller/controller.hpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/controller/application.cpp b/src/controller/application.cpp index c83080c6..d5e672d9 100644 --- a/src/controller/application.cpp +++ b/src/controller/application.cpp @@ -74,7 +74,6 @@ Application::Application(int& argc, char** argv, const QString& name) : } registerMetatypes(); - setupLogging(); #ifdef Q_OS_MAC menuBar = std::make_unique(); diff --git a/src/controller/controller.cpp b/src/controller/controller.cpp index 2386ad7b..af5fd1e4 100644 --- a/src/controller/controller.cpp +++ b/src/controller/controller.cpp @@ -31,6 +31,7 @@ #include "application.hpp" #include "inputoutputmode.hpp" +#include "logging.hpp" #include "writeresponse.hpp" using namespace pcsc_cpp; @@ -53,6 +54,11 @@ QVariantMap makeErrorObject(const QString& errorCode, const QString& errorMessag } // namespace +Controller::Controller(CommandWithArguments&& cmd) : command(std::move(cmd)) +{ + setupLogging(); +} + void Controller::run() noexcept try { // If a command is passed, the application is in command-line mode, else in stdin/stdout mode. diff --git a/src/controller/controller.hpp b/src/controller/controller.hpp index 82c465e5..33314e9c 100644 --- a/src/controller/controller.hpp +++ b/src/controller/controller.hpp @@ -32,7 +32,7 @@ class Controller : public QObject Q_OBJECT public: - explicit Controller(CommandWithArguments&& cmd) : command(std::move(cmd)) { } + explicit Controller(CommandWithArguments&& cmd); const QVariantMap& result() const { return _result; }