Merge pull request #3340 from MarcelEdward/hifi-19916

Hifi 19916
This commit is contained in:
Stephen Birarda 2014-09-03 14:20:13 -07:00
commit 4554a89754
3 changed files with 10 additions and 11 deletions

View file

@ -3349,8 +3349,6 @@ void Application::updateLocationInServer() {
if (accountManager.isLoggedIn()) {
static QJsonObject lastLocationObject;
// construct a QJsonObject given the user's current address information
QJsonObject updatedLocationObject;
@ -3361,14 +3359,9 @@ void Application::updateLocationInServer() {
updatedLocationObject.insert("address", addressObject);
if (updatedLocationObject != lastLocationObject) {
accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation,
JSONCallbackParameters(), QJsonDocument(updatedLocationObject).toJson());
lastLocationObject = updatedLocationObject;
}
}
accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation,
JSONCallbackParameters(), QJsonDocument(updatedLocationObject).toJson());
}
}
void Application::domainChanged(const QString& domainHostname) {

View file

@ -1897,7 +1897,12 @@ void MyAvatar::resetSize() {
void MyAvatar::goToLocationFromResponse(const QJsonObject& jsonObject) {
QJsonObject locationObject = jsonObject["data"].toObject()["address"].toObject();
goToLocationFromAddress(locationObject);
bool isOnline = jsonObject["data"].toObject()["online"].toBool();
if (isOnline ) {
goToLocationFromAddress(locationObject);
} else {
QMessageBox::warning(Application::getInstance()->getWindow(), "", "The user is not online.");
}
}
void MyAvatar::goToLocationFromAddress(const QJsonObject& locationObject) {

View file

@ -1,5 +1,6 @@
# add the test directories
file(GLOB TEST_SUBDIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
list(REMOVE_ITEM TEST_SUBDIRS "CMakeFiles")
foreach(DIR ${TEST_SUBDIRS})
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}")
add_subdirectory(${DIR})