History

Merge branch 'master' into 20263

David Rowe committed 11 years ago

Commit 95efe982 parents ebe8007 89967fb109 files · +681 −487Browse files

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

Unified · Split

interface/src/Application.cpp+76−45
@@ -85,6 +85,8 @@ · 84 unmodified lines
85#include "Util.h"85#include "Util.h"
86 86
87#include "audio/AudioToolBox.h"87#include "audio/AudioToolBox.h"
88#include "audio/AudioIOStatsRenderer.h"
89#include "audio/AudioScope.h"
88 90
89#include "devices/DdeFaceTracker.h"91#include "devices/DdeFaceTracker.h"
90#include "devices/Faceshift.h"92#include "devices/Faceshift.h"
@@ -142,8 +144,42 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt · 51 unmodified lines
142 }144 }
143}145}
144 146
147bool setupEssentials(int& argc, char** argv) {
148 unsigned int listenPort = 0; // bind to an ephemeral port by default
149 const char** constArgv = const_cast<const char**>(argv);
150 const char* portStr = getCmdOption(argc, constArgv, "--listenPort");
151 if (portStr) {
152 listenPort = atoi(portStr);
153 }
154
155 DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
156
157 // Set dependencies
158 auto glCanvas = DependencyManager::set<GLCanvas>();
159 auto addressManager = DependencyManager::set<AddressManager>();
160 auto nodeList = DependencyManager::set<NodeList>(NodeType::Agent, listenPort);
161 auto geometryCache = DependencyManager::set<GeometryCache>();
162 auto glowEffect = DependencyManager::set<GlowEffect>();
163 auto faceshift = DependencyManager::set<Faceshift>();
164 auto audio = DependencyManager::set<Audio>();
165 auto audioScope = DependencyManager::set<AudioScope>();
166 auto audioIOStatsRenderer = DependencyManager::set<AudioIOStatsRenderer>();
167 auto deferredLightingEffect = DependencyManager::set<DeferredLightingEffect>();
168 auto ambientOcclusionEffect = DependencyManager::set<AmbientOcclusionEffect>();
169 auto textureCache = DependencyManager::set<TextureCache>();
170 auto animationCache = DependencyManager::set<AnimationCache>();
171 auto visage = DependencyManager::set<Visage>();
172 auto ddeFaceTracker = DependencyManager::set<DdeFaceTracker>();
173 auto modelBlender = DependencyManager::set<ModelBlender>();
174 auto audioToolBox = DependencyManager::set<AudioToolBox>();
175
176 return true;
177}
178
179
145Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :180Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
146 QApplication(argc, argv),181 QApplication(argc, argv),
182 _dependencyManagerIsSetup(setupEssentials(argc, argv)),
147 _window(new MainWindow(desktop())),183 _window(new MainWindow(desktop())),
148 _toolWindow(NULL),184 _toolWindow(NULL),
149 _nodeThread(new QThread(this)),185 _nodeThread(new QThread(this)),
@@ -189,9 +225,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 39 unmodified lines
189 _isVSyncOn(true),225 _isVSyncOn(true),
190 _aboutToQuit(false)226 _aboutToQuit(false)
191{227{
192 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();228 auto glCanvas = DependencyManager::get<GLCanvas>();
229 auto nodeList = DependencyManager::get<NodeList>();
193 Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us230 Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
194 231
232
195 // read the ApplicationInfo.ini file for Name/Version/Domain information233 // read the ApplicationInfo.ini file for Name/Version/Domain information
196 QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);234 QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
197 235
@@ -224,23 +262,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 26 unmodified lines
224 _window->setMenuBar(Menu::getInstance());262 _window->setMenuBar(Menu::getInstance());
225 263
226 _runningScriptsWidget = new RunningScriptsWidget(_window);264 _runningScriptsWidget = new RunningScriptsWidget(_window);
227
228 unsigned int listenPort = 0; // bind to an ephemeral port by default
229 const char** constArgv = const_cast<const char**>(argv);
230 const char* portStr = getCmdOption(argc, constArgv, "--listenPort");
231 if (portStr) {
232 listenPort = atoi(portStr);
233 }
234 265
235 // start the nodeThread so its event loop is running266 // start the nodeThread so its event loop is running
236 _nodeThread->start();267 _nodeThread->start();
237 268
238 // make sure the node thread is given highest priority269 // make sure the node thread is given highest priority
239 _nodeThread->setPriority(QThread::TimeCriticalPriority);270 _nodeThread->setPriority(QThread::TimeCriticalPriority);
240 271
241 // put the NodeList and datagram processing on the node thread272 // put the NodeList and datagram processing on the node thread
242 NodeList* nodeList = NodeList::createInstance(NodeType::Agent, listenPort);
243
244 nodeList->moveToThread(_nodeThread);273 nodeList->moveToThread(_nodeThread);
245 _datagramProcessor.moveToThread(_nodeThread);274 _datagramProcessor.moveToThread(_nodeThread);
246 275
@@ -250,7 +279,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 3 unmodified lines
250 // put the audio processing on a separate thread279 // put the audio processing on a separate thread
251 QThread* audioThread = new QThread(this);280 QThread* audioThread = new QThread(this);
252 281
253 Audio::SharedPointer audioIO = DependencyManager::get<Audio>();282 auto audioIO = DependencyManager::get<Audio>();
254 audioIO->moveToThread(audioThread);283 audioIO->moveToThread(audioThread);
255 connect(audioThread, &QThread::started, audioIO.data(), &Audio::start);284 connect(audioThread, &QThread::started, audioIO.data(), &Audio::start);
256 285
@@ -273,11 +302,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 16 unmodified lines
273 connect(locationUpdateTimer, &QTimer::timeout, this, &Application::updateLocationInServer);302 connect(locationUpdateTimer, &QTimer::timeout, this, &Application::updateLocationInServer);
274 locationUpdateTimer->start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);303 locationUpdateTimer->start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);
275 304
276 connect(nodeList, &NodeList::nodeAdded, this, &Application::nodeAdded);305 connect(nodeList.data(), &NodeList::nodeAdded, this, &Application::nodeAdded);
277 connect(nodeList, &NodeList::nodeKilled, this, &Application::nodeKilled);306 connect(nodeList.data(), &NodeList::nodeKilled, this, &Application::nodeKilled);
278 connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)), SLOT(nodeKilled(SharedNodePointer)));307 connect(nodeList.data(), SIGNAL(nodeKilled(SharedNodePointer)), SLOT(nodeKilled(SharedNodePointer)));
279 connect(nodeList, &NodeList::uuidChanged, _myAvatar, &MyAvatar::setSessionUUID);308 connect(nodeList.data(), &NodeList::uuidChanged, _myAvatar, &MyAvatar::setSessionUUID);
280 connect(nodeList, &NodeList::limitOfSilentDomainCheckInsReached, nodeList, &NodeList::reset);309 connect(nodeList.data(), &NodeList::limitOfSilentDomainCheckInsReached, nodeList.data(), &NodeList::reset);
281 310
282 // connect to appropriate slots on AccountManager311 // connect to appropriate slots on AccountManager
283 AccountManager& accountManager = AccountManager::getInstance();312 AccountManager& accountManager = AccountManager::getInstance();
@@ -303,7 +332,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 19 unmodified lines
303 // once the event loop has started, check and signal for an access token332 // once the event loop has started, check and signal for an access token
304 QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);333 QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);
305 334
306 AddressManager::SharedPointer addressManager = DependencyManager::get<AddressManager>();335 auto addressManager = DependencyManager::get<AddressManager>();
307 336
308 // use our MyAvatar position and quat for address manager path337 // use our MyAvatar position and quat for address manager path
309 addressManager->setPositionGetter(getPositionForPath);338 addressManager->setPositionGetter(getPositionForPath);
@@ -327,7 +356,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 17 unmodified lines
327 356
328 // move the silentNodeTimer to the _nodeThread357 // move the silentNodeTimer to the _nodeThread
329 QTimer* silentNodeTimer = new QTimer();358 QTimer* silentNodeTimer = new QTimer();
330 connect(silentNodeTimer, SIGNAL(timeout()), nodeList, SLOT(removeSilentNodes()));359 connect(silentNodeTimer, SIGNAL(timeout()), nodeList.data(), SLOT(removeSilentNodes()));
331 silentNodeTimer->start(NODE_SILENCE_THRESHOLD_MSECS);360 silentNodeTimer->start(NODE_SILENCE_THRESHOLD_MSECS);
332 silentNodeTimer->moveToThread(_nodeThread);361 silentNodeTimer->moveToThread(_nodeThread);
333 362
@@ -446,7 +475,7 @@ Application::~Application() { · 112 unmodified lines
446 // kill any audio injectors that are still around475 // kill any audio injectors that are still around
447 AudioScriptingInterface::getInstance().stopAllInjectors();476 AudioScriptingInterface::getInstance().stopAllInjectors();
448 477
449 Audio::SharedPointer audioIO = DependencyManager::get<Audio>();478 auto audioIO = DependencyManager::get<Audio>();
450 479
451 // stop the audio process480 // stop the audio process
452 QMetaObject::invokeMethod(audioIO.data(), "stop", Qt::BlockingQueuedConnection);481 QMetaObject::invokeMethod(audioIO.data(), "stop", Qt::BlockingQueuedConnection);
@@ -461,6 +490,8 @@ Application::~Application() { · 8 unmodified lines
461 Menu::getInstance()->deleteLater();490 Menu::getInstance()->deleteLater();
462 491
463 _myAvatar = NULL;492 _myAvatar = NULL;
493
494 DependencyManager::destroy<GLCanvas>();
464}495}
465 496
466void Application::saveSettings() {497void Application::saveSettings() {
@@ -736,7 +767,7 @@ void Application::controlledBroadcastToNodes(const QByteArray& packet, const Nod · 269 unmodified lines
736 foreach(NodeType_t type, destinationNodeTypes) {767 foreach(NodeType_t type, destinationNodeTypes) {
737 768
738 // Perform the broadcast for one type769 // Perform the broadcast for one type
739 int nReceivingNodes = NodeList::getInstance()->broadcastToNodes(packet, NodeSet() << type);770 int nReceivingNodes = DependencyManager::get<NodeList>()->broadcastToNodes(packet, NodeSet() << type);
740 771
741 // Feed number of bytes to corresponding channel of the bandwidth meter, if any (done otherwise)772 // Feed number of bytes to corresponding channel of the bandwidth meter, if any (done otherwise)
742 BandwidthMeter::ChannelIndex channel;773 BandwidthMeter::ChannelIndex channel;
@@ -955,7 +986,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 212 unmodified lines
955 if (isShifted) {986 if (isShifted) {
956 _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f);987 _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f);
957 if (TV3DManager::isConnected()) {988 if (TV3DManager::isConnected()) {
958 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();989 auto glCanvas = DependencyManager::get<GLCanvas>();
959 TV3DManager::configureCamera(_myCamera, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());990 TV3DManager::configureCamera(_myCamera, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
960 }991 }
961 } else {992 } else {
@@ -968,7 +999,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 6 unmodified lines
968 if (isShifted) {999 if (isShifted) {
969 _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f);1000 _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f);
970 if (TV3DManager::isConnected()) {1001 if (TV3DManager::isConnected()) {
971 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();1002 auto glCanvas = DependencyManager::get<GLCanvas>();
972 TV3DManager::configureCamera(_myCamera, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());1003 TV3DManager::configureCamera(_myCamera, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
973 }1004 }
974 1005
@@ -1330,7 +1361,7 @@ void Application::dropEvent(QDropEvent *event) { · 355 unmodified lines
1330 SnapshotMetaData* snapshotData = Snapshot::parseSnapshotData(snapshotPath);1361 SnapshotMetaData* snapshotData = Snapshot::parseSnapshotData(snapshotPath);
1331 if (snapshotData) {1362 if (snapshotData) {
1332 if (!snapshotData->getDomain().isEmpty()) {1363 if (!snapshotData->getDomain().isEmpty()) {
1333 NodeList::getInstance()->getDomainHandler().setHostnameAndPort(snapshotData->getDomain());1364 DependencyManager::get<NodeList>()->getDomainHandler().setHostnameAndPort(snapshotData->getDomain());
1334 }1365 }
1335 1366
1336 _myAvatar->setPosition(snapshotData->getLocation());1367 _myAvatar->setPosition(snapshotData->getLocation());
@@ -1344,7 +1375,7 @@ void Application::dropEvent(QDropEvent *event) { · 7 unmodified lines
1344}1375}
1345 1376
1346void Application::sendPingPackets() {1377void Application::sendPingPackets() {
1347 QByteArray pingPacket = NodeList::getInstance()->constructPingPacket();1378 QByteArray pingPacket = DependencyManager::get<NodeList>()->constructPingPacket();
1348 controlledBroadcastToNodes(pingPacket, NodeSet()1379 controlledBroadcastToNodes(pingPacket, NodeSet()
1349 << NodeType::EntityServer1380 << NodeType::EntityServer
1350 << NodeType::AudioMixer << NodeType::AvatarMixer1381 << NodeType::AudioMixer << NodeType::AvatarMixer
@@ -1370,7 +1401,7 @@ void Application::timer() { · 19 unmodified lines
1370 _timerStart.start();1401 _timerStart.start();
1371 1402
1372 // ask the node list to check in with the domain server1403 // ask the node list to check in with the domain server
1373 NodeList::getInstance()->sendDomainServerCheckIn();1404 DependencyManager::get<NodeList>()->sendDomainServerCheckIn();
1374}1405}
1375 1406
1376void Application::idle() {1407void Application::idle() {
@@ -1426,7 +1457,7 @@ void Application::idle() { · 49 unmodified lines
1426 1457
1427void Application::checkBandwidthMeterClick() {1458void Application::checkBandwidthMeterClick() {
1428 // ... to be called upon button release1459 // ... to be called upon button release
1429 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();1460 auto glCanvas = DependencyManager::get<GLCanvas>();
1430 if (Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth) &&1461 if (Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth) &&
1431 Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&1462 Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&
1432 Menu::getInstance()->isOptionChecked(MenuOption::UserInterface) &&1463 Menu::getInstance()->isOptionChecked(MenuOption::UserInterface) &&
@@ -1462,7 +1493,7 @@ void Application::setFullscreen(bool fullscreen) { · 29 unmodified lines
1462}1493}
1463 1494
1464void Application::setEnable3DTVMode(bool enable3DTVMode) {1495void Application::setEnable3DTVMode(bool enable3DTVMode) {
1465 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();1496 auto glCanvas = DependencyManager::get<GLCanvas>();
1466 resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());1497 resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
1467}1498}
1468 1499
@@ -1488,7 +1519,7 @@ void Application::setEnableVRMode(bool enableVRMode) { · 19 unmodified lines
1488 _myCamera.setHmdRotation(glm::quat());1519 _myCamera.setHmdRotation(glm::quat());
1489 }1520 }
1490 1521
1491 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();1522 auto glCanvas = DependencyManager::get<GLCanvas>();
1492 resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());1523 resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
1493}1524}
1494 1525
@@ -1498,7 +1529,7 @@ void Application::setLowVelocityFilter(bool lowVelocityFilter) { · 3 unmodified lines
1498 1529
1499bool Application::mouseOnScreen() const {1530bool Application::mouseOnScreen() const {
1500 if (OculusManager::isConnected()) {1531 if (OculusManager::isConnected()) {
1501 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();1532 auto glCanvas = DependencyManager::get<GLCanvas>();
1502 return getMouseX() >= 0 && getMouseX() <= glCanvas->getDeviceWidth() &&1533 return getMouseX() >= 0 && getMouseX() <= glCanvas->getDeviceWidth() &&
1503 getMouseY() >= 0 && getMouseY() <= glCanvas->getDeviceHeight();1534 getMouseY() >= 0 && getMouseY() <= glCanvas->getDeviceHeight();
1504 }1535 }
@@ -1540,9 +1571,9 @@ int Application::getMouseDragStartedY() const { · 35 unmodified lines
1540}1571}
1541 1572
1542FaceTracker* Application::getActiveFaceTracker() {1573FaceTracker* Application::getActiveFaceTracker() {
1543 Faceshift::SharedPointer faceshift = DependencyManager::get<Faceshift>();1574 auto faceshift = DependencyManager::get<Faceshift>();
1544 Visage::SharedPointer visage = DependencyManager::get<Visage>();1575 auto visage = DependencyManager::get<Visage>();
1545 DdeFaceTracker::SharedPointer dde = DependencyManager::get<DdeFaceTracker>();1576 auto dde = DependencyManager::get<DdeFaceTracker>();
1546 1577
1547 return (dde->isActive() ? static_cast<FaceTracker*>(dde.data()) :1578 return (dde->isActive() ? static_cast<FaceTracker*>(dde.data()) :
1548 (faceshift->isActive() ? static_cast<FaceTracker*>(faceshift.data()) :1579 (faceshift->isActive() ? static_cast<FaceTracker*>(faceshift.data()) :
@@ -1658,7 +1689,7 @@ void Application::init() { · 109 unmodified lines
1658 Leapmotion::init();1689 Leapmotion::init();
1659 1690
1660 // fire off an immediate domain-server check in now that settings are loaded1691 // fire off an immediate domain-server check in now that settings are loaded
1661 NodeList::getInstance()->sendDomainServerCheckIn();1692 DependencyManager::get<NodeList>()->sendDomainServerCheckIn();
1662 1693
1663 _entities.init();1694 _entities.init();
1664 _entities.setViewFrustum(getViewFrustum());1695 _entities.setViewFrustum(getViewFrustum());
@@ -1686,7 +1717,7 @@ void Application::init() { · 21 unmodified lines
1686 1717
1687 _metavoxels.init();1718 _metavoxels.init();
1688 1719
1689 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();1720 auto glCanvas = DependencyManager::get<GLCanvas>();
1690 _rearMirrorTools = new RearMirrorTools(glCanvas.data(), _mirrorViewRect, _settings);1721 _rearMirrorTools = new RearMirrorTools(glCanvas.data(), _mirrorViewRect, _settings);
1691 1722
1692 connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView()));1723 connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView()));
@@ -1776,7 +1807,7 @@ void Application::updateMouseRay() { · 83 unmodified lines
1776void Application::updateFaceshift() {1807void Application::updateFaceshift() {
1777 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1808 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1778 PerformanceWarning warn(showWarnings, "Application::updateFaceshift()");1809 PerformanceWarning warn(showWarnings, "Application::updateFaceshift()");
1779 Faceshift::SharedPointer faceshift = DependencyManager::get<Faceshift>();1810 auto faceshift = DependencyManager::get<Faceshift>();
1780 // Update faceshift1811 // Update faceshift
1781 faceshift->update();1812 faceshift->update();
1782 1813
@@ -2125,7 +2156,7 @@ int Application::sendNackPackets() { · 342 unmodified lines
2125 char packet[MAX_PACKET_SIZE];2156 char packet[MAX_PACKET_SIZE];
2126 2157
2127 // iterates thru all nodes in NodeList2158 // iterates thru all nodes in NodeList
2128 NodeList* nodeList = NodeList::getInstance();2159 auto nodeList = DependencyManager::get<NodeList>();
2129 2160
2130 nodeList->eachNode([&](const SharedNodePointer& node){2161 nodeList->eachNode([&](const SharedNodePointer& node){
2131 2162
@@ -2223,7 +2254,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 91 unmodified lines
2223 int inViewServers = 0;2254 int inViewServers = 0;
2224 int unknownJurisdictionServers = 0;2255 int unknownJurisdictionServers = 0;
2225 2256
2226 NodeList* nodeList = NodeList::getInstance();2257 auto nodeList = DependencyManager::get<NodeList>();
2227 2258
2228 nodeList->eachNode([&](const SharedNodePointer& node) {2259 nodeList->eachNode([&](const SharedNodePointer& node) {
2229 // only send to the NodeTypes that are serverType2260 // only send to the NodeTypes that are serverType
@@ -2587,7 +2618,7 @@ void Application::updateShadowMap() { · 357 unmodified lines
2587 2618
2588 fbo->release();2619 fbo->release();
2589 2620
2590 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();2621 auto glCanvas = DependencyManager::get<GLCanvas>();
2591 glViewport(0, 0, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());2622 glViewport(0, 0, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
2592}2623}
2593 2624
@@ -2923,7 +2954,7 @@ bool Application::getCascadeShadowsEnabled() { · 329 unmodified lines
2923}2954}
2924 2955
2925glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) {2956glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) {
2926 GLCanvas::SharedPointer glCanvas = DependencyManager::get<GLCanvas>();2957 auto glCanvas = DependencyManager::get<GLCanvas>();
2927 float horizontalScale = glCanvas->getDeviceWidth() / 2.0f;2958 float horizontalScale = glCanvas->getDeviceWidth() / 2.0f;
2928 float verticalScale = glCanvas->getDeviceHeight() / 2.0f;2959 float verticalScale = glCanvas->getDeviceHeight() / 2.0f;
2929 2960
@@ -3109,7 +3140,7 @@ void Application::setMenuShortcutsEnabled(bool enabled) { · 179 unmodified lines
3109void Application::updateWindowTitle(){3140void Application::updateWindowTitle(){
3110 3141
3111 QString buildVersion = " (build " + applicationVersion() + ")";3142 QString buildVersion = " (build " + applicationVersion() + ")";
3112 NodeList* nodeList = NodeList::getInstance();3143 auto nodeList = DependencyManager::get<NodeList>();
3113 3144
3114 QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED) ";3145 QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED) ";
3115 QString username = AccountManager::getInstance().getAccountInfo().getUsername();3146 QString username = AccountManager::getInstance().getAccountInfo().getUsername();
@@ -3126,7 +3157,7 @@ void Application::updateWindowTitle(){ · 10 unmodified lines
3126void Application::updateLocationInServer() {3157void Application::updateLocationInServer() {
3127 3158
3128 AccountManager& accountManager = AccountManager::getInstance();3159 AccountManager& accountManager = AccountManager::getInstance();
3129 DomainHandler& domainHandler = NodeList::getInstance()->getDomainHandler();3160 DomainHandler& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler();
3130 3161
3131 if (accountManager.isLoggedIn() && domainHandler.isConnected() && !domainHandler.getUUID().isNull()) {3162 if (accountManager.isLoggedIn() && domainHandler.isConnected() && !domainHandler.getUUID().isNull()) {
3132 3163
@@ -3177,7 +3208,7 @@ void Application::domainChanged(const QString& domainHostname) { · 44 unmodified lines
3177 3208
3178void Application::connectedToDomain(const QString& hostname) {3209void Application::connectedToDomain(const QString& hostname) {
3179 AccountManager& accountManager = AccountManager::getInstance();3210 AccountManager& accountManager = AccountManager::getInstance();
3180 const QUuid& domainID = NodeList::getInstance()->getDomainHandler().getUUID();3211 const QUuid& domainID = DependencyManager::get<NodeList>()->getDomainHandler().getUUID();
3181 3212
3182 if (accountManager.isLoggedIn() && !domainID.isNull()) {3213 if (accountManager.isLoggedIn() && !domainID.isNull()) {
3183 // update our data-server with the domain-server we're logged in with3214 // update our data-server with the domain-server we're logged in with
@@ -3464,8 +3495,8 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 280 unmodified lines
3464 // when the application is about to quit, stop our script engine so it unwinds properly3495 // when the application is about to quit, stop our script engine so it unwinds properly
3465 connect(this, SIGNAL(aboutToQuit()), scriptEngine, SLOT(stop()));3496 connect(this, SIGNAL(aboutToQuit()), scriptEngine, SLOT(stop()));
3466 3497
3467 NodeList* nodeList = NodeList::getInstance();3498 auto nodeList = DependencyManager::get<NodeList>();
3468 connect(nodeList, &NodeList::nodeKilled, scriptEngine, &ScriptEngine::nodeKilled);3499 connect(nodeList.data(), &NodeList::nodeKilled, scriptEngine, &ScriptEngine::nodeKilled);
3469 3500
3470 scriptEngine->moveToThread(workerThread);3501 scriptEngine->moveToThread(workerThread);
3471 3502

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t