mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 22:27:13 +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",
|
||||
"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 PATH_VIEWPOINT_KEY = "viewpoint";
|
||||
const QString INDEX_PATH = "/";
|
||||
|
||||
// check out paths in the _configMap to see if we have a match
|
||||
const QVariant* pathMatch = valueForKeyPath(_settingsManager.getSettingsMap(),
|
||||
QString(PATHS_SETTINGS_KEYPATH_FORMAT).arg(SETTINGS_PATHS_KEY)
|
||||
.arg(pathQuery));
|
||||
if (pathMatch) {
|
||||
auto keypath = QString(PATHS_SETTINGS_KEYPATH_FORMAT).arg(SETTINGS_PATHS_KEY).arg(pathQuery);
|
||||
const QVariant* pathMatch = valueForKeyPath(_settingsManager.getSettingsMap(), keypath);
|
||||
|
||||
// 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
|
||||
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()) {
|
||||
QByteArray viewpointUTF8 = responseViewpoint.toUtf8();
|
||||
|
|
Loading…
Reference in a new issue