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; }