mirror of
https://github.com/overte-org/overte.git
synced 2025-04-24 05:53:29 +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;
|
||||
auto doc = QJsonDocument::fromJson(contents, &jsonError);
|
||||
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
|
||||
QJsonObject rootObject;
|
||||
QJsonObject userStoryObject;
|
||||
userStoryObject.insert("thumbnail_url", thumbnail_url);
|
||||
userStoryObject.insert("thumbnail_url", thumbnailUrl);
|
||||
userStoryObject.insert("place_name", placeName);
|
||||
userStoryObject.insert("action", "snapshot");
|
||||
rootObject.insert("user_story", userStoryObject);
|
||||
|
||||
|
|
Loading…
Reference in a new issue