Skip to content

Commit

Permalink
Merge pull request #150 from cristian64/make_dirs_lockfile
Browse files Browse the repository at this point in the history
Attempt to make the directories before trying to lock the lockfile.
  • Loading branch information
dreamsyntax authored May 19, 2024
2 parents bd8f6b0 + 5c81246 commit dc50134
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/GUI/Settings/SConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include <iostream>

#include <qcoreapplication.h>
#include <QDir>
#include <qfile.h>
#include <QFileInfo>

namespace
{
Expand Down Expand Up @@ -32,6 +34,7 @@ SConfig::SConfig()
}

const QString lockFilepath{m_settings->fileName() + "_lock"};
QDir().mkpath(QFileInfo{lockFilepath}.absolutePath());
m_lockFile = std::make_unique<QLockFile>(lockFilepath);
if (!m_lockFile->tryLock())
{
Expand Down

0 comments on commit dc50134

Please sign in to comment.