From 153c871bd2c038c66bfa5c525c52e7ef081c168a Mon Sep 17 00:00:00 2001 From: Dominik Louven Date: Fri, 27 Mar 2020 14:41:36 +0100 Subject: [PATCH] Fixi profile.json unable to create on linux --- ScreenPlay/src/settings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ScreenPlay/src/settings.cpp b/ScreenPlay/src/settings.cpp index 399d70fc..9dd77a31 100644 --- a/ScreenPlay/src/settings.cpp +++ b/ScreenPlay/src/settings.cpp @@ -123,6 +123,10 @@ Settings::Settings(const shared_ptr& globalVariables, void Settings::writeJsonFileFromResource(const QString& filename) { QFile file(m_globalVariables->localSettingsPath().toString() + "/" + filename + ".json"); + QDir directory(m_globalVariables->localSettingsPath().toString()); + if(!directory.exists()){ + directory.mkpath(directory.path()); + } QFile defaultSettings(":/" + filename + ".json"); file.open(QIODevice::WriteOnly | QIODevice::Text);