From c8db50cb20bb1ed9b3180ec87d2f34d293931375 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Thu, 10 Jan 2019 13:54:41 -0800 Subject: [PATCH] start up logger before loading plugins. put a plugin-interface version into the meta data of each plugin. don't load plugins that don't match the current version. --- interface/src/Application.cpp | 6 +++--- interface/src/Application.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 134c375b56..b27403f56c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -724,6 +724,8 @@ const QString TEST_RESULTS_LOCATION_COMMAND{ "--testResultsLocation" }; bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { const char** constArgv = const_cast(argv); + qInstallMessageHandler(messageHandler); + // HRS: I could not figure out how to move these any earlier in startup, so when using this option, be sure to also supply // --allowMultipleInstances auto reportAndQuit = [&](const char* commandSwitch, std::function report) { @@ -974,6 +976,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo QApplication(argc, argv), _window(new MainWindow(desktop())), _sessionRunTimer(startupTimer), + _logger(new FileLogger(this)), _previousSessionCrashed(setupEssentials(argc, argv, runningMarkerExisted)), _entitySimulation(new PhysicalEntitySimulation()), _physicsEngine(new PhysicsEngine(Vectors::ZERO)), @@ -1063,9 +1066,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo installNativeEventFilter(&MyNativeEventFilter::getInstance()); #endif - _logger = new FileLogger(this); - qInstallMessageHandler(messageHandler); - QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf"); QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/fontawesome-webfont.ttf"); QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/hifi-glyphs.ttf"); diff --git a/interface/src/Application.h b/interface/src/Application.h index dc30c3c22c..b1077a523a 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -594,6 +594,8 @@ private: bool _aboutToQuit { false }; + FileLogger* _logger; + bool _previousSessionCrashed; DisplayPluginPointer _displayPlugin; @@ -674,8 +676,6 @@ private: QPointer _entityScriptServerLogDialog; QDir _defaultScriptsLocation; - FileLogger* _logger; - TouchEvent _lastTouchEvent; quint64 _lastNackTime;