mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
always respond with default index path
This commit is contained in:
parent
e371aa8ba5
commit
15c922f4a5
2 changed files with 17 additions and 6 deletions
|
@ -65,7 +65,7 @@
|
||||||
{
|
{
|
||||||
"name": "viewpoint",
|
"name": "viewpoint",
|
||||||
"label": "Viewpoint",
|
"label": "Viewpoint",
|
||||||
"placeholder": "/512,512,512"
|
"placeholder": "/0,0,0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1872,16 +1872,27 @@ void DomainServer::processPathQueryPacket(QSharedPointer<ReceivedMessage> messag
|
||||||
|
|
||||||
const QString PATHS_SETTINGS_KEYPATH_FORMAT = "%1.%2";
|
const QString PATHS_SETTINGS_KEYPATH_FORMAT = "%1.%2";
|
||||||
const QString PATH_VIEWPOINT_KEY = "viewpoint";
|
const QString PATH_VIEWPOINT_KEY = "viewpoint";
|
||||||
|
const QString INDEX_PATH = "/";
|
||||||
|
|
||||||
// check out paths in the _configMap to see if we have a match
|
// check out paths in the _configMap to see if we have a match
|
||||||
const QVariant* pathMatch = valueForKeyPath(_settingsManager.getSettingsMap(),
|
auto keypath = QString(PATHS_SETTINGS_KEYPATH_FORMAT).arg(SETTINGS_PATHS_KEY).arg(pathQuery);
|
||||||
QString(PATHS_SETTINGS_KEYPATH_FORMAT).arg(SETTINGS_PATHS_KEY)
|
const QVariant* pathMatch = valueForKeyPath(_settingsManager.getSettingsMap(), keypath);
|
||||||
.arg(pathQuery));
|
|
||||||
if (pathMatch) {
|
// if we didn't match the path BUT this is for the index path then send back our default
|
||||||
|
|
||||||
|
|
||||||
|
if (pathMatch || pathQuery == INDEX_PATH) {
|
||||||
// we got a match, respond with the resulting viewpoint
|
// we got a match, respond with the resulting viewpoint
|
||||||
auto nodeList = DependencyManager::get<LimitedNodeList>();
|
auto nodeList = DependencyManager::get<LimitedNodeList>();
|
||||||
|
|
||||||
QString responseViewpoint = pathMatch->toMap()[PATH_VIEWPOINT_KEY].toString();
|
QString responseViewpoint;
|
||||||
|
|
||||||
|
if (pathMatch) {
|
||||||
|
responseViewpoint = pathMatch->toMap()[PATH_VIEWPOINT_KEY].toString();
|
||||||
|
} else {
|
||||||
|
const QString DEFAULT_INDEX_PATH = "/0,0,0/0,0,0,1";
|
||||||
|
responseViewpoint = DEFAULT_INDEX_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
if (!responseViewpoint.isEmpty()) {
|
if (!responseViewpoint.isEmpty()) {
|
||||||
QByteArray viewpointUTF8 = responseViewpoint.toUtf8();
|
QByteArray viewpointUTF8 = responseViewpoint.toUtf8();
|
||||||
|
|
Loading…
Reference in a new issue