use temporary domain name as place name on ID lookup

This commit is contained in:
Stephen Birarda 2016-08-22 17:17:13 -07:00
parent 2b5d862263
commit edd4f5853e

View file

@ -360,6 +360,7 @@ void AddressManager::goToAddressFromObject(const QVariantMap& dataObject, const
LookupTrigger trigger = (LookupTrigger) reply.property(LOOKUP_TRIGGER_KEY).toInt();
// set our current root place id to the ID that came back
const QString PLACE_ID_KEY = "id";
_rootPlaceID = rootMap[PLACE_ID_KEY].toUuid();
@ -368,6 +369,15 @@ void AddressManager::goToAddressFromObject(const QVariantMap& dataObject, const
const QString PLACE_NAME_KEY = "name";
QString placeName = rootMap[PLACE_NAME_KEY].toString();
if (placeName.isEmpty()) {
// we didn't get a set place name, check if there is a default or temporary domain name to use
const QString TEMPORARY_DOMAIN_NAME_KEY = "name";
if (domainObject.contains(TEMPORARY_DOMAIN_NAME_KEY)) {
placeName = domainObject[TEMPORARY_DOMAIN_NAME_KEY].toString();
}
}
if (!placeName.isEmpty()) {
if (setHost(placeName, trigger)) {
trigger = LookupTrigger::Internal;