mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:10:37 +02:00
First guess on how to deal with place
Fall back to host when there is no place. Probably better ideas, like specify the name and the type (a place, a domain if no place, etc...) will come soon.
This commit is contained in:
parent
c8f3a898d2
commit
8457acd234
1 changed files with 7 additions and 2 deletions
|
@ -188,12 +188,17 @@ void SnapshotUploader::uploadSuccess(QNetworkReply& reply) {
|
||||||
QJsonParseError jsonError;
|
QJsonParseError jsonError;
|
||||||
auto doc = QJsonDocument::fromJson(contents, &jsonError);
|
auto doc = QJsonDocument::fromJson(contents, &jsonError);
|
||||||
if (jsonError.error == QJsonParseError::NoError) {
|
if (jsonError.error == QJsonParseError::NoError) {
|
||||||
QString thumbnail_url = doc.object().value("thumbnail_url").toString();
|
QString thumbnailUrl = doc.object().value("thumbnail_url").toString();
|
||||||
|
QString placeName = DependencyManager::get<AddressManager>()->getPlaceName();
|
||||||
|
if(placeName.isEmpty()) {
|
||||||
|
placeName = DependencyManager::get<AddressManager>()->getHost();
|
||||||
|
}
|
||||||
|
|
||||||
// create json post data
|
// create json post data
|
||||||
QJsonObject rootObject;
|
QJsonObject rootObject;
|
||||||
QJsonObject userStoryObject;
|
QJsonObject userStoryObject;
|
||||||
userStoryObject.insert("thumbnail_url", thumbnail_url);
|
userStoryObject.insert("thumbnail_url", thumbnailUrl);
|
||||||
|
userStoryObject.insert("place_name", placeName);
|
||||||
userStoryObject.insert("action", "snapshot");
|
userStoryObject.insert("action", "snapshot");
|
||||||
rootObject.insert("user_story", userStoryObject);
|
rootObject.insert("user_story", userStoryObject);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue