GH-2059 fix instance directory not being created on first launch
This commit is contained in:
parent
44475350eb
commit
6d034bda82
4 changed files with 10 additions and 14 deletions
|
@ -34,12 +34,13 @@ struct WatchLock
|
|||
FolderInstanceProvider::FolderInstanceProvider(SettingsObjectPtr settings, const QString& instDir)
|
||||
: BaseInstanceProvider(settings)
|
||||
{
|
||||
// Normalize path
|
||||
m_instDir = QDir(instDir).canonicalPath();
|
||||
if (!QDir::current().exists(m_instDir))
|
||||
// Create aand normalize path
|
||||
if (!QDir::current().exists(instDir))
|
||||
{
|
||||
QDir::current().mkpath(m_instDir);
|
||||
QDir::current().mkpath(instDir);
|
||||
}
|
||||
// NOTE: canonicalPath requires the path to exist. Do not move this above the creation block!
|
||||
m_instDir = QDir(instDir).canonicalPath();
|
||||
m_watcher = new QFileSystemWatcher(this);
|
||||
connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &FolderInstanceProvider::instanceDirContentsChanged);
|
||||
m_watcher->addPath(m_instDir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue