History

Merge pull request #4402 from birarda/master

add underlying controls for user discoverability

Andrew Meadows committed 11 years ago

Commit a758ccd2 parents d662c30 de382217 files · +178 −51Browse files

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

Unified · Split

interface/src/Application.cpp+5−41
@@ -87,6 +87,7 @@ · 86 unmodified lines
8787
8888 #include "Application.h"
8989 #include "AudioClient.h"
90+#include "DiscoverabilityManager.h"
9091 #include "InterfaceVersion.h"
9192 #include "LODManager.h"
9293 #include "Menu.h"
@@ -246,6 +247,7 @@ bool setupEssentials(int& argc, char** argv) { · 153 unmodified lines
246247 #if defined(Q_OS_MAC) || defined(Q_OS_WIN)
247248 auto speechRecognizer = DependencyManager::set<SpeechRecognizer>();
248249 #endif
250+ auto discoverabilityManager = DependencyManager::set<DiscoverabilityManager>();
249251
250252 return true;
251253 }
@@ -367,11 +369,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 115 unmodified lines
367369 connect(&domainHandler, &DomainHandler::hostnameChanged,
368370 DependencyManager::get<AddressManager>().data(), &AddressManager::storeCurrentAddress);
369371
370− // update our location every 5 seconds in the data-server, assuming that we are authenticated with one
372+ // update our location every 5 seconds in the metaverse server, assuming that we are authenticated with one
371373 const qint64 DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS = 5 * 1000;
372374
373375 locationUpdateTimer = new QTimer(this);
374− connect(locationUpdateTimer, &QTimer::timeout, this, &Application::updateLocationInServer);
376+ auto discoverabilityManager = DependencyManager::get<DiscoverabilityManager>();
377+ connect(locationUpdateTimer, &QTimer::timeout, discoverabilityManager.data(), &DiscoverabilityManager::updateLocation);
375378 locationUpdateTimer->start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);
376379
377380 connect(nodeList.data(), &NodeList::nodeAdded, this, &Application::nodeAdded);
@@ -3191,45 +3194,6 @@ void Application::updateWindowTitle(){ · 2813 unmodified lines
31913194 _window->setWindowTitle(title);
31923195 }
31933196
3194−void Application::updateLocationInServer() {
3195−
3196− AccountManager& accountManager = AccountManager::getInstance();
3197− auto addressManager = DependencyManager::get<AddressManager>();
3198− DomainHandler& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler();
3199−
3200− if (accountManager.isLoggedIn() && domainHandler.isConnected()
3201− && (!addressManager->getRootPlaceID().isNull() || !domainHandler.getUUID().isNull())) {
3202−
3203− // construct a QJsonObject given the user's current address information
3204− QJsonObject rootObject;
3205−
3206− QJsonObject locationObject;
3207−
3208− QString pathString = addressManager->currentPath();
3209−
3210− const QString LOCATION_KEY_IN_ROOT = "location";
3211−
3212− const QString PATH_KEY_IN_LOCATION = "path";
3213− locationObject.insert(PATH_KEY_IN_LOCATION, pathString);
3214−
3215− if (!addressManager->getRootPlaceID().isNull()) {
3216− const QString PLACE_ID_KEY_IN_LOCATION = "place_id";
3217− locationObject.insert(PLACE_ID_KEY_IN_LOCATION,
3218− uuidStringWithoutCurlyBraces(addressManager->getRootPlaceID()));
3219−
3220− } else {
3221− const QString DOMAIN_ID_KEY_IN_LOCATION = "domain_id";
3222− locationObject.insert(DOMAIN_ID_KEY_IN_LOCATION,
3223− uuidStringWithoutCurlyBraces(domainHandler.getUUID()));
3224− }
3225−
3226− rootObject.insert(LOCATION_KEY_IN_ROOT, locationObject);
3227−
3228− accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation,
3229− JSONCallbackParameters(), QJsonDocument(rootObject).toJson());
3230− }
3231−}
3232−
32333197 void Application::clearDomainOctreeDetails() {
32343198 qDebug() << "Clearing domain octree details...";
32353199 // reset the environment so that we don't erroneously end up with multiple

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