mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:28:02 +02:00
force models file to end in .json.gz
This commit is contained in:
parent
ff239a7c6a
commit
90b78feb1e
2 changed files with 8 additions and 2 deletions
|
@ -1153,6 +1153,11 @@ void OctreeServer::domainSettingsRequestComplete() {
|
||||||
absoluteFilePath = QDir(ServerPathUtils::getDataFilePath("entities/")).absoluteFilePath(_persistFilePath);
|
absoluteFilePath = QDir(ServerPathUtils::getDataFilePath("entities/")).absoluteFilePath(_persistFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// force the persist file to end with .json.gz
|
||||||
|
if (!absoluteFilePath.endsWith(".json.gz", Qt::CaseInsensitive)) {
|
||||||
|
absoluteFilePath += ".json.gz";
|
||||||
|
}
|
||||||
|
|
||||||
if (!QFile::exists(absoluteFilePath)) {
|
if (!QFile::exists(absoluteFilePath)) {
|
||||||
qDebug() << "Persist file does not exist, checking for existence of persist file next to application";
|
qDebug() << "Persist file does not exist, checking for existence of persist file next to application";
|
||||||
|
|
||||||
|
@ -1179,7 +1184,8 @@ void OctreeServer::domainSettingsRequestComplete() {
|
||||||
pathToCopyFrom = oldDefaultPersistPath;
|
pathToCopyFrom = oldDefaultPersistPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDir persistFileDirectory { QDir { absoluteFilePath }.dirName() };
|
QDir persistFileDirectory { QDir::cleanPath(absoluteFilePath + "/..") };
|
||||||
|
|
||||||
if (!persistFileDirectory.exists()) {
|
if (!persistFileDirectory.exists()) {
|
||||||
qDebug() << "Creating data directory " << persistFileDirectory.absolutePath();
|
qDebug() << "Creating data directory " << persistFileDirectory.absolutePath();
|
||||||
persistFileDirectory.mkpath(".");
|
persistFileDirectory.mkpath(".");
|
||||||
|
|
|
@ -385,7 +385,7 @@
|
||||||
{
|
{
|
||||||
"name": "persistFilePath",
|
"name": "persistFilePath",
|
||||||
"label": "Entities File Path",
|
"label": "Entities File Path",
|
||||||
"help": "The path to the file entities are stored in. If this path is relative it will be relative to the application data directory. The entities file extension should be .json.gz.",
|
"help": "The path to the file entities are stored in. If this path is relative it will be relative to the application data directory. The filename must end in .json.gz.",
|
||||||
"placeholder": "models.json.gz",
|
"placeholder": "models.json.gz",
|
||||||
"default": "models.json.gz",
|
"default": "models.json.gz",
|
||||||
"advanced": true
|
"advanced": true
|
||||||
|
|
Loading…
Reference in a new issue