Core: Fix possible race conditions when reading or writing config file

This commit is contained in:
wmayer
2024-05-06 11:57:23 +02:00
parent 984e4df2a1
commit 281230c520
5 changed files with 72 additions and 13 deletions

View File

@@ -43,6 +43,7 @@
#include "MainWindow.h"
#include "Language/Translator.h"
#include <App/Application.h>
#include <Base/Console.h>
using namespace Gui;
@@ -233,6 +234,7 @@ void StartupPostProcess::execute()
setBranding();
showMainWindow();
activateWorkbench();
checkParameters();
}
void StartupPostProcess::setWindowTitle()
@@ -545,3 +547,15 @@ void StartupPostProcess::autoloadModules(const QStringList& wb)
}
}
}
void StartupPostProcess::checkParameters()
{
if (App::GetApplication().GetSystemParameter().IgnoreSave()) {
Base::Console().Warning("System parameter file couldn't be opened.\n"
"Continue with an empty configuration that won't be saved.\n");
}
if (App::GetApplication().GetUserParameter().IgnoreSave()) {
Base::Console().Warning("User parameter file couldn't be opened.\n"
"Continue with an empty configuration that won't be saved.\n");
}
}