mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Add cmd line opt to disable settings reset popup
This commit is contained in:
parent
cc16dc07df
commit
1403fad04e
3 changed files with 10 additions and 3 deletions
|
@ -389,7 +389,10 @@ bool setupEssentials(int& argc, char** argv) {
|
|||
|
||||
Setting::preInit();
|
||||
|
||||
bool previousSessionCrashed = CrashHandler::checkForResetSettings();
|
||||
|
||||
static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";
|
||||
bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);
|
||||
bool previousSessionCrashed = CrashHandler::checkForResetSettings(suppressPrompt);
|
||||
CrashHandler::writeRunningMarkerFiler();
|
||||
qAddPostRoutine(CrashHandler::deleteRunningMarkerFile);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||
|
||||
bool CrashHandler::checkForResetSettings() {
|
||||
bool CrashHandler::checkForResetSettings(bool suppressPrompt) {
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QSettings settings;
|
||||
settings.beginGroup("Developer");
|
||||
|
@ -42,6 +42,10 @@ bool CrashHandler::checkForResetSettings() {
|
|||
QFile runningMarkerFile(runningMarkerFilePath());
|
||||
bool wasLikelyCrash = runningMarkerFile.exists();
|
||||
|
||||
if (suppressPrompt) {
|
||||
return wasLikelyCrash;
|
||||
}
|
||||
|
||||
if (wasLikelyCrash || askToResetSettings) {
|
||||
if (displaySettingsResetOnCrash || askToResetSettings) {
|
||||
Action action = promptUserForAction(wasLikelyCrash);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
class CrashHandler {
|
||||
|
||||
public:
|
||||
static bool checkForResetSettings();
|
||||
static bool checkForResetSettings(bool suppressPrompt = false);
|
||||
|
||||
static void writeRunningMarkerFiler();
|
||||
static void deleteRunningMarkerFile();
|
||||
|
|
Loading…
Reference in a new issue