From 58bdfa49a94945dfbf374e8926750b4555d5f07d Mon Sep 17 00:00:00 2001 From: Colin Duquesnoy Date: Mon, 19 Nov 2018 18:11:56 +0100 Subject: [PATCH] Make sure that debug builds behave the same as release builds See issue #294 --- src/lib/infrastructure/src/Application/SingleInstance.cpp | 4 ---- src/main/DI.hpp | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lib/infrastructure/src/Application/SingleInstance.cpp b/src/lib/infrastructure/src/Application/SingleInstance.cpp index 9fb59902..7f788a09 100644 --- a/src/lib/infrastructure/src/Application/SingleInstance.cpp +++ b/src/lib/infrastructure/src/Application/SingleInstance.cpp @@ -170,9 +170,6 @@ void SingleInstance::pollState() bool SingleInstance::checkForPrimary() { -#ifdef QT_DEBUG - return true; -#else QLockFile lockFile(QDir::tempPath() + QDir::separator() + qApp->applicationName() + ".lock"); lockFile.setStaleLockTime(0); bool primary = false; @@ -181,5 +178,4 @@ bool SingleInstance::checkForPrimary() lockFile.unlock(); } return primary; -#endif } diff --git a/src/main/DI.hpp b/src/main/DI.hpp index 33a486b6..7363f181 100644 --- a/src/main/DI.hpp +++ b/src/main/DI.hpp @@ -107,9 +107,6 @@ struct ApplicationFactory { auto baseApplication = make_shared(qtApplication); -#ifdef QT_DEBUG - auto withLogging = make_shared(baseApplication, commandLineArguments); -#else IPlayer& player = injector.template create(); IFactory& localServerFactory = injector.template create&>(); IFactory& localSocketFactory = injector.template create&>(); @@ -118,7 +115,7 @@ struct ApplicationFactory { commandLineArguments, localServerFactory, localSocketFactory); auto withLogging = make_shared(singleInstance, commandLineArguments); -#endif + object_ = make_shared(withLogging, commandLineArguments); } return object_;