From 128451928009eaf120b37598ec8de6ff506fa729 Mon Sep 17 00:00:00 2001 From: Albert S Date: Sat, 24 Aug 2019 09:41:07 +0200 Subject: [PATCH] create config dir instead of complaining it doesn't exist --- main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index c0fee98..10ef308 100644 --- a/main.cpp +++ b/main.cpp @@ -44,8 +44,11 @@ int main(int argc, char *argv[]) QDir dir; if(!dir.exists(configDirectoryPath)) { - QMessageBox::warning(nullptr, "Directory not found", configDirectoryPath + " was not found!"); - return 1; + if(!dir.mkdir(configDirectoryPath)) + { + QMessageBox::warning(nullptr, "Failed to create dir", configDirectoryPath + " was not found and could not be created!"); + return 1; + } } QSettings settings(configDirectoryPath + "qsrun.config", QSettings::NativeFormat);