force models file to end in .json.gz

This commit is contained in:
Stephen Birarda 2016-02-02 15:37:34 -08:00
parent ff239a7c6a
commit 90b78feb1e
2 changed files with 8 additions and 2 deletions
assignment-client/src/octree
domain-server/resources

View file

@ -1153,6 +1153,11 @@ void OctreeServer::domainSettingsRequestComplete() {
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)) {
qDebug() << "Persist file does not exist, checking for existence of persist file next to application";
@ -1179,7 +1184,8 @@ void OctreeServer::domainSettingsRequestComplete() {
pathToCopyFrom = oldDefaultPersistPath;
}
QDir persistFileDirectory { QDir { absoluteFilePath }.dirName() };
QDir persistFileDirectory { QDir::cleanPath(absoluteFilePath + "/..") };
if (!persistFileDirectory.exists()) {
qDebug() << "Creating data directory " << persistFileDirectory.absolutePath();
persistFileDirectory.mkpath(".");

View file

@ -385,7 +385,7 @@
{
"name": "persistFilePath",
"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",
"default": "models.json.gz",
"advanced": true