From d5c87a0db686f01655a23d6a90613b91bb96112e Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 17 Oct 2016 12:02:23 -0700 Subject: [PATCH] CR feedback --- interface/src/Application.cpp | 30 +++++++++++++------------- libraries/shared/src/RunningMarker.cpp | 3 +++ libraries/shared/src/RunningMarker.h | 4 ++-- server-console/src/main.js | 2 +- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 26d1270293..13fa51df24 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -579,15 +579,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo bool wantsSandboxRunning = shouldRunServer(); - bool determinedSandboxState = false; - bool sandboxRunning = false; + static bool determinedSandboxState = false; + static bool sandboxRunning = false; SandboxUtils sandboxUtils; sandboxUtils.ifLocalSandboxRunningElse([&]() { - qDebug() << "Home sandbox appears to be running....."; + qCDebug(interfaceapp) << "Home sandbox appears to be running....."; determinedSandboxState = true; sandboxRunning = true; }, [&]() { - qDebug() << "Home sandbox does not appear to be running...."; + qCDebug(interfaceapp) << "Home sandbox does not appear to be running...."; determinedSandboxState = true; sandboxRunning = false; if (wantsSandboxRunning) { @@ -1292,7 +1292,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // Get sandbox content set version, if available auto acDirPath = PathUtils::getRootDataDirectory() + BuildInfo::MODIFIED_ORGANIZATION + "/assignment-client/"; auto contentVersionPath = acDirPath + "content-version.txt"; - qDebug() << "Checking " << contentVersionPath << " for content version"; + qCDebug(interfaceapp) << "Checking " << contentVersionPath << " for content version"; auto contentVersion = 0; QFile contentVersionFile(contentVersionPath); if (contentVersionFile.open(QIODevice::ReadOnly | QIODevice::Text)) { @@ -1300,7 +1300,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // toInt() returns 0 if the conversion fails, so we don't need to specifically check for failure contentVersion = line.toInt(); } - qDebug() << "Server content version: " << contentVersion; + qCDebug(interfaceapp) << "Server content version: " << contentVersion; bool hasTutorialContent = contentVersion >= 1; @@ -1310,10 +1310,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo bool shouldGoToTutorial = hasHMDAndHandControllers && hasTutorialContent && !tutorialComplete.get(); - qDebug() << "Has HMD + Hand Controllers: " << hasHMDAndHandControllers << ", current plugin: " << _displayPlugin->getName(); - qDebug() << "Has tutorial content: " << hasTutorialContent; - qDebug() << "Tutorial complete: " << tutorialComplete.get(); - qDebug() << "Should go to tutorial: " << shouldGoToTutorial; + qCDebug(interfaceapp) << "Has HMD + Hand Controllers: " << hasHMDAndHandControllers << ", current plugin: " << _displayPlugin->getName(); + qCDebug(interfaceapp) << "Has tutorial content: " << hasTutorialContent; + qCDebug(interfaceapp) << "Tutorial complete: " << tutorialComplete.get(); + qCDebug(interfaceapp) << "Should go to tutorial: " << shouldGoToTutorial; // when --url in command line, teleport to location const QString HIFI_URL_COMMAND_LINE_KEY = "--url"; @@ -1327,10 +1327,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo if (shouldGoToTutorial) { sandboxUtils.ifLocalSandboxRunningElse([=]() { - qDebug() << "Home sandbox appears to be running, going to Home."; + qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; DependencyManager::get()->goToLocalSandbox(TUTORIAL_PATH); }, [=]() { - qDebug() << "Home sandbox does not appear to be running, going to Entry."; + qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; if (firstRun.get()) { showHelp(); } @@ -1352,17 +1352,17 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo if (isFirstRun) { if (hasHMDAndHandControllers) { sandboxUtils.ifLocalSandboxRunningElse([=]() { - qDebug() << "Home sandbox appears to be running, going to Home."; + qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home."; DependencyManager::get()->goToLocalSandbox(); }, [=]() { - qDebug() << "Home sandbox does not appear to be running, going to Entry."; + qCDebug(interfaceapp) << "Home sandbox does not appear to be running, going to Entry."; DependencyManager::get()->goToEntry(); }); } else { DependencyManager::get()->goToEntry(); } } else { - qDebug() << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString); + qCDebug(interfaceapp) << "Not first run... going to" << qPrintable(addressLookupString.isEmpty() ? QString("previous location") : addressLookupString); DependencyManager::get()->loadSettings(addressLookupString); } } diff --git a/libraries/shared/src/RunningMarker.cpp b/libraries/shared/src/RunningMarker.cpp index 269ade8a40..d0d45fd517 100644 --- a/libraries/shared/src/RunningMarker.cpp +++ b/libraries/shared/src/RunningMarker.cpp @@ -41,6 +41,9 @@ void RunningMarker::startRunningMarker() { writeRunningMarkerFiler(); }); runningMarkerTimer->start(RUNNING_STATE_CHECK_IN_MSECS); + + // put the time on the thread + runningMarkerTimer->moveToThread(runningMarkerThread); } RunningMarker::~RunningMarker() { diff --git a/libraries/shared/src/RunningMarker.h b/libraries/shared/src/RunningMarker.h index ad657d612c..ca670496a5 100644 --- a/libraries/shared/src/RunningMarker.h +++ b/libraries/shared/src/RunningMarker.h @@ -2,8 +2,8 @@ // RunningMarker.h // interface/src // -// Created by David Rowe on 24 Aug 2015. -// Copyright 2015 High Fidelity, Inc. +// Created by Brad Hefta-Gaub on 2016-10-15. +// Copyright 2016 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/server-console/src/main.js b/server-console/src/main.js index 19ef5acab2..72f4520020 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -859,7 +859,7 @@ function onContentLoaded() { var MAX_TIME_SINCE_EDIT = 5000; // 5 seconds between updates var firstAttemptToCheck = new Date().getTime(); var shutdownWatchInterval = setInterval(function(){ - var stats = fs.stat(argv.shutdownWatcher,function(err, stats) { + var stats = fs.stat(argv.shutdownWatcher, function(err, stats) { if (err) { var sinceFirstCheck = new Date().getTime() - firstAttemptToCheck; if (sinceFirstCheck > MAX_TIME_SINCE_EDIT) {