Update entity server to always make resource directory if it does not exist

This commit is contained in:
Ryan Huffman 2016-01-26 13:50:58 -08:00
parent ab133f37a0
commit a731a571e0

View file

@ -1172,15 +1172,15 @@ void OctreeServer::domainSettingsRequestComplete() {
pathToCopyFrom = oldDefaultPersistPath;
}
QDir persistFileDirectory = QDir(persistPath).filePath("..");
if (!persistFileDirectory.exists()) {
qDebug() << "Creating data directory " << persistFileDirectory.absolutePath();
persistFileDirectory.mkpath(".");
}
if (shouldCopy) {
qDebug() << "Old persist file found, copying from " << pathToCopyFrom << " to " << persistPath;
QDir persistFileDirectory = QDir(persistPath).filePath("..");
if (!persistFileDirectory.exists()) {
qDebug() << "Creating data directory " << persistFileDirectory.path();
persistFileDirectory.mkpath(".");
}
QFile::copy(pathToCopyFrom, persistPath);
} else {
qDebug() << "No existing persist file found";