Core: Fix possible race conditions when reading or writing config file
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user