History

Merge remote-tracking branch 'hifi/master' into android_places_goto

Cristian Luis Duarte committed 8 years ago

Commit 744fa802 parents b26bf30 3ac4a1d256 files · +5354 −1753Browse files

Showing the changes to interface/src/Application.cpp (1 of 256 files). Show all

Unified · Split

interface/src/Application.cpp+14−18
@@ -225,8 +225,8 @@ · 224 unmodified lines
225#ifdef DEBUG_EVENT_QUEUE225#ifdef DEBUG_EVENT_QUEUE
226// This is a HACK that uses private headers included with the qt source distrubution.226// This is a HACK that uses private headers included with the qt source distrubution.
227// To use this feature you need to add these directores to your include path:227// To use this feature you need to add these directores to your include path:
228// E:/Qt/5.9.1/Src/qtbase/include/QtCore/5.9.1/QtCore228// E:/Qt/5.10.1/Src/qtbase/include/QtCore/5.10.1/QtCore
229// E:/Qt/5.9.1/Src/qtbase/include/QtCore/5.9.1229// E:/Qt/5.10.1/Src/qtbase/include/QtCore/5.10.1
230#define QT_BOOTSTRAPPED230#define QT_BOOTSTRAPPED
231#include <private/qthread_p.h>231#include <private/qthread_p.h>
232#include <private/qobject_p.h>232#include <private/qobject_p.h>
@@ -491,7 +491,7 @@ public: · 258 unmodified lines
491 // Don't actually crash in debug builds, in case this apparent deadlock is simply from491 // Don't actually crash in debug builds, in case this apparent deadlock is simply from
492 // the developer actively debugging code492 // the developer actively debugging code
493 #ifdef NDEBUG493 #ifdef NDEBUG
494 deadlockDetectionCrash();494 deadlockDetectionCrash();
495 #endif495 #endif
496 }496 }
497 }497 }
@@ -774,7 +774,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 276 unmodified lines
774 steamClient->init();774 steamClient->init();
775 }775 }
776 776
777 DependencyManager::set<tracing::Tracer>();
778 PROFILE_SET_THREAD_NAME("Main Thread");777 PROFILE_SET_THREAD_NAME("Main Thread");
779 778
780#if defined(Q_OS_WIN)779#if defined(Q_OS_WIN)
@@ -959,10 +958,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 178 unmodified lines
959 auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();958 auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
960 setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));959 setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
961 setProperty(hifi::properties::CRASHED, _previousSessionCrashed);960 setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
962
963 {961 {
964 const QString TEST_SCRIPT = "--testScript";962 const QString TEST_SCRIPT = "--testScript";
965 const QString TRACE_FILE = "--traceFile";
966 const QStringList args = arguments();963 const QStringList args = arguments();
967 for (int i = 0; i < args.size() - 1; ++i) {964 for (int i = 0; i < args.size() - 1; ++i) {
968 if (args.at(i) == TEST_SCRIPT) {965 if (args.at(i) == TEST_SCRIPT) {
@@ -970,10 +967,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1 unmodified line
970 if (QFileInfo(testScriptPath).exists()) {967 if (QFileInfo(testScriptPath).exists()) {
971 setProperty(hifi::properties::TEST, QUrl::fromLocalFile(testScriptPath));968 setProperty(hifi::properties::TEST, QUrl::fromLocalFile(testScriptPath));
972 }969 }
973 } else if (args.at(i) == TRACE_FILE) {
974 QString traceFilePath = args.at(i + 1);
975 setProperty(hifi::properties::TRACING, traceFilePath);
976 DependencyManager::get<tracing::Tracer>()->startTracing();
977 }970 }
978 }971 }
979 }972 }
@@ -1019,6 +1012,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 39 unmodified lines
1019 auto nodeList = DependencyManager::get<NodeList>();1012 auto nodeList = DependencyManager::get<NodeList>();
1020 nodeList->startThread();1013 nodeList->startThread();
1021 1014
1015 const char** constArgv = const_cast<const char**>(argv);
1016 if (cmdOptionExists(argc, constArgv, "--disableWatchdog")) {
1017 DISABLE_WATCHDOG = true;
1018 }
1022 // Set up a watchdog thread to intentionally crash the application on deadlocks1019 // Set up a watchdog thread to intentionally crash the application on deadlocks
1023 if (!DISABLE_WATCHDOG) {1020 if (!DISABLE_WATCHDOG) {
1024 (new DeadlockWatchdogThread())->start();1021 (new DeadlockWatchdogThread())->start();
@@ -1228,7 +1225,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 203 unmodified lines
1228 connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent);1225 connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent);
1229 connect(&_entityEditSender, &EntityEditPacketSender::addingEntityWithCertificate, this, &Application::addingEntityWithCertificate);1226 connect(&_entityEditSender, &EntityEditPacketSender::addingEntityWithCertificate, this, &Application::addingEntityWithCertificate);
1230 1227
1231 const char** constArgv = const_cast<const char**>(argv);
1232 QString concurrentDownloadsStr = getCmdOption(argc, constArgv, "--concurrent-downloads");1228 QString concurrentDownloadsStr = getCmdOption(argc, constArgv, "--concurrent-downloads");
1233 bool success;1229 bool success;
1234 int concurrentDownloads = concurrentDownloadsStr.toInt(&success);1230 int concurrentDownloads = concurrentDownloadsStr.toInt(&success);
@@ -2039,7 +2035,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 804 unmodified lines
2039 });2035 });
2040 2036
2041 _snapshotSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/snap.wav"));2037 _snapshotSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/snap.wav"));
2042 2038
2043 QVariant testProperty = property(hifi::properties::TEST);2039 QVariant testProperty = property(hifi::properties::TEST);
2044 qDebug() << testProperty;2040 qDebug() << testProperty;
2045 if (testProperty.isValid()) {2041 if (testProperty.isValid()) {
@@ -6584,7 +6580,7 @@ void Application::addAssetToWorldFromURL(QString url) { · 4538 unmodified lines
6584 } else {6580 } else {
6585 filename.remove(".zip");6581 filename.remove(".zip");
6586 }6582 }
6587 6583
6588 }6584 }
6589 6585
6590 if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {6586 if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {
@@ -6758,7 +6754,7 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q · 167 unmodified lines
6758 addAssetToWorldError(filenameFromPath(filePath), errorInfo);6754 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
6759 } else {6755 } else {
6760 // to prevent files that aren't models or texture files from being loaded into world automatically6756 // to prevent files that aren't models or texture files from being loaded into world automatically
6761 if ((filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION)) || 6757 if ((filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION)) ||
6762 ((filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) &&6758 ((filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) &&
6763 ((!isBlocks) && (!isZip)))) {6759 ((!isBlocks) && (!isZip)))) {
6764 addAssetToWorldAddEntity(filePath, mapping);6760 addAssetToWorldAddEntity(filePath, mapping);
@@ -7407,8 +7403,8 @@ bool Application::isThrottleRendering() const { · 642 unmodified lines
7407bool Application::hasFocus() const {7403bool Application::hasFocus() const {
7408 bool result = (QApplication::activeWindow() != nullptr);7404 bool result = (QApplication::activeWindow() != nullptr);
7409#if defined(Q_OS_WIN)7405#if defined(Q_OS_WIN)
7410 // On Windows, QWidget::activateWindow() - as called in setFocus() - makes the application's taskbar icon flash but doesn't 7406 // On Windows, QWidget::activateWindow() - as called in setFocus() - makes the application's taskbar icon flash but doesn't
7411 // take user focus away from their current window. So also check whether the application is the user's current foreground 7407 // take user focus away from their current window. So also check whether the application is the user's current foreground
7412 // window.7408 // window.
7413 result = result && (HWND)QApplication::activeWindow()->winId() == GetForegroundWindow();7409 result = result && (HWND)QApplication::activeWindow()->winId() == GetForegroundWindow();
7414#endif7410#endif
@@ -7416,7 +7412,7 @@ bool Application::hasFocus() const { · 1 unmodified line
7416}7412}
7417 7413
7418void Application::setFocus() {7414void Application::setFocus() {
7419 // Note: Windows doesn't allow a user focus to be taken away from another application. Instead, it changes the color of and 7415 // Note: Windows doesn't allow a user focus to be taken away from another application. Instead, it changes the color of and
7420 // flashes the taskbar icon.7416 // flashes the taskbar icon.
7421 auto window = qApp->getWindow();7417 auto window = qApp->getWindow();
7422 window->activateWindow();7418 window->activateWindow();
@@ -7657,7 +7653,7 @@ void Application::updateDisplayMode() { · 234 unmodified lines
7657 menu->setIsOptionChecked(MenuOption::FirstPerson, true);7653 menu->setIsOptionChecked(MenuOption::FirstPerson, true);
7658 cameraMenuChanged();7654 cameraMenuChanged();
7659 }7655 }
7660 7656
7661 // Remove the mirror camera option from menu if in HMD mode7657 // Remove the mirror camera option from menu if in HMD mode
7662 auto mirrorAction = menu->getActionForOption(MenuOption::FullscreenMirror);7658 auto mirrorAction = menu->getActionForOption(MenuOption::FullscreenMirror);
7663 mirrorAction->setVisible(!isHmd);7659 mirrorAction->setVisible(!isHmd);