fix check for existing persist file directory

This commit is contained in:
Stephen Birarda 2016-02-02 14:38:17 -08:00
parent cfff765731
commit 4d91b8b7d6

View file

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