CR feedback

This commit is contained in:
Brad Hefta-Gaub 2016-10-17 12:02:23 -07:00
parent d46170bec0
commit d5c87a0db6
4 changed files with 21 additions and 18 deletions

View file

@ -579,15 +579,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
bool wantsSandboxRunning = shouldRunServer(); bool wantsSandboxRunning = shouldRunServer();
bool determinedSandboxState = false; static bool determinedSandboxState = false;
bool sandboxRunning = false; static bool sandboxRunning = false;
SandboxUtils sandboxUtils; SandboxUtils sandboxUtils;
sandboxUtils.ifLocalSandboxRunningElse([&]() { sandboxUtils.ifLocalSandboxRunningElse([&]() {
qDebug() << "Home sandbox appears to be running....."; qCDebug(interfaceapp) << "Home sandbox appears to be running.....";
determinedSandboxState = true; determinedSandboxState = true;
sandboxRunning = true; sandboxRunning = true;
}, [&]() { }, [&]() {
qDebug() << "Home sandbox does not appear to be running...."; qCDebug(interfaceapp) << "Home sandbox does not appear to be running....";
determinedSandboxState = true; determinedSandboxState = true;
sandboxRunning = false; sandboxRunning = false;
if (wantsSandboxRunning) { if (wantsSandboxRunning) {
@ -1292,7 +1292,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
// Get sandbox content set version, if available // Get sandbox content set version, if available
auto acDirPath = PathUtils::getRootDataDirectory() + BuildInfo::MODIFIED_ORGANIZATION + "/assignment-client/"; auto acDirPath = PathUtils::getRootDataDirectory() + BuildInfo::MODIFIED_ORGANIZATION + "/assignment-client/";
auto contentVersionPath = acDirPath + "content-version.txt"; auto contentVersionPath = acDirPath + "content-version.txt";
qDebug() << "Checking " << contentVersionPath << " for content version"; qCDebug(interfaceapp) << "Checking " << contentVersionPath << " for content version";
auto contentVersion = 0; auto contentVersion = 0;
QFile contentVersionFile(contentVersionPath); QFile contentVersionFile(contentVersionPath);
if (contentVersionFile.open(QIODevice::ReadOnly | QIODevice::Text)) { 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 // toInt() returns 0 if the conversion fails, so we don't need to specifically check for failure
contentVersion = line.toInt(); contentVersion = line.toInt();
} }
qDebug() << "Server content version: " << contentVersion; qCDebug(interfaceapp) << "Server content version: " << contentVersion;
bool hasTutorialContent = contentVersion >= 1; bool hasTutorialContent = contentVersion >= 1;
@ -1310,10 +1310,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
bool shouldGoToTutorial = hasHMDAndHandControllers && hasTutorialContent && !tutorialComplete.get(); bool shouldGoToTutorial = hasHMDAndHandControllers && hasTutorialContent && !tutorialComplete.get();
qDebug() << "Has HMD + Hand Controllers: " << hasHMDAndHandControllers << ", current plugin: " << _displayPlugin->getName(); qCDebug(interfaceapp) << "Has HMD + Hand Controllers: " << hasHMDAndHandControllers << ", current plugin: " << _displayPlugin->getName();
qDebug() << "Has tutorial content: " << hasTutorialContent; qCDebug(interfaceapp) << "Has tutorial content: " << hasTutorialContent;
qDebug() << "Tutorial complete: " << tutorialComplete.get(); qCDebug(interfaceapp) << "Tutorial complete: " << tutorialComplete.get();
qDebug() << "Should go to tutorial: " << shouldGoToTutorial; qCDebug(interfaceapp) << "Should go to tutorial: " << shouldGoToTutorial;
// when --url in command line, teleport to location // when --url in command line, teleport to location
const QString HIFI_URL_COMMAND_LINE_KEY = "--url"; const QString HIFI_URL_COMMAND_LINE_KEY = "--url";
@ -1327,10 +1327,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
if (shouldGoToTutorial) { if (shouldGoToTutorial) {
sandboxUtils.ifLocalSandboxRunningElse([=]() { 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<AddressManager>()->goToLocalSandbox(TUTORIAL_PATH); DependencyManager::get<AddressManager>()->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()) { if (firstRun.get()) {
showHelp(); showHelp();
} }
@ -1352,17 +1352,17 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
if (isFirstRun) { if (isFirstRun) {
if (hasHMDAndHandControllers) { if (hasHMDAndHandControllers) {
sandboxUtils.ifLocalSandboxRunningElse([=]() { 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<AddressManager>()->goToLocalSandbox(); DependencyManager::get<AddressManager>()->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<AddressManager>()->goToEntry(); DependencyManager::get<AddressManager>()->goToEntry();
}); });
} else { } else {
DependencyManager::get<AddressManager>()->goToEntry(); DependencyManager::get<AddressManager>()->goToEntry();
} }
} else { } 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<AddressManager>()->loadSettings(addressLookupString); DependencyManager::get<AddressManager>()->loadSettings(addressLookupString);
} }
} }

View file

@ -41,6 +41,9 @@ void RunningMarker::startRunningMarker() {
writeRunningMarkerFiler(); writeRunningMarkerFiler();
}); });
runningMarkerTimer->start(RUNNING_STATE_CHECK_IN_MSECS); runningMarkerTimer->start(RUNNING_STATE_CHECK_IN_MSECS);
// put the time on the thread
runningMarkerTimer->moveToThread(runningMarkerThread);
} }
RunningMarker::~RunningMarker() { RunningMarker::~RunningMarker() {

View file

@ -2,8 +2,8 @@
// RunningMarker.h // RunningMarker.h
// interface/src // interface/src
// //
// Created by David Rowe on 24 Aug 2015. // Created by Brad Hefta-Gaub on 2016-10-15.
// Copyright 2015 High Fidelity, Inc. // Copyright 2016 High Fidelity, Inc.
// //
// Distributed under the Apache License, Version 2.0. // Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html

View file

@ -859,7 +859,7 @@ function onContentLoaded() {
var MAX_TIME_SINCE_EDIT = 5000; // 5 seconds between updates var MAX_TIME_SINCE_EDIT = 5000; // 5 seconds between updates
var firstAttemptToCheck = new Date().getTime(); var firstAttemptToCheck = new Date().getTime();
var shutdownWatchInterval = setInterval(function(){ var shutdownWatchInterval = setInterval(function(){
var stats = fs.stat(argv.shutdownWatcher,function(err, stats) { var stats = fs.stat(argv.shutdownWatcher, function(err, stats) {
if (err) { if (err) {
var sinceFirstCheck = new Date().getTime() - firstAttemptToCheck; var sinceFirstCheck = new Date().getTime() - firstAttemptToCheck;
if (sinceFirstCheck > MAX_TIME_SINCE_EDIT) { if (sinceFirstCheck > MAX_TIME_SINCE_EDIT) {