mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:48:56 +02:00
use mkpath to create new data directory
This commit is contained in:
parent
74806d9d2b
commit
483e0f419b
1 changed files with 9 additions and 6 deletions
|
@ -139,13 +139,16 @@ void HifiConfigVariantMap::loadMasterAndUserConfig(const QStringList& argumentLi
|
||||||
// we have the old file and not the new file - time to copy the file
|
// we have the old file and not the new file - time to copy the file
|
||||||
|
|
||||||
// make the destination directory if it doesn't exist
|
// make the destination directory if it doesn't exist
|
||||||
QDir().mkdir(ServerPathUtils::getDataDirectory());
|
auto dataDirectory = ServerPathUtils::getDataDirectory();
|
||||||
|
if (QDir().mkpath(dataDirectory)) {
|
||||||
if (oldConfigFile.copy(_userConfigFilename)) {
|
if (oldConfigFile.copy(_userConfigFilename)) {
|
||||||
qDebug() << "Migrated config file from" << oldConfigFilename << "to" << _userConfigFilename;
|
qDebug() << "Migrated config file from" << oldConfigFilename << "to" << _userConfigFilename;
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Could not copy previous config file from" << oldConfigFilename << "to" << _userConfigFilename
|
qWarning() << "Could not copy previous config file from" << oldConfigFilename << "to" << _userConfigFilename
|
||||||
<< "- please try to copy manually and restart.";
|
<< "- please try to copy manually and restart.";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
qWarning() << "Could not create application data directory" << dataDirectory << "- unable to migrate previous config file.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue