summaryrefslogtreecommitdiff
path: root/src/moapplication.cpp
diff options
context:
space:
mode:
authorQudix <17361645+Qudix@users.noreply.github.com>2020-11-14 00:36:57 -0600
committerQudix <17361645+Qudix@users.noreply.github.com>2020-11-14 00:36:57 -0600
commit24991bf5fb1dcf4ccee1090285bec10b3a20bf81 (patch)
tree49a9444ae24e25263ebee6ea601e4c5bb239447a /src/moapplication.cpp
parent125fc7a82e5ddf51b91f834661f7de9356831714 (diff)
parent579f94b5b6014ad4a97b23eb2a26ab69f007aa6a (diff)
Merge branch 'master' of https://github.com/ModOrganizer2/modorganizer into master
Diffstat (limited to 'src/moapplication.cpp')
-rw-r--r--src/moapplication.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/moapplication.cpp b/src/moapplication.cpp
index 9139acbb..e7ac3926 100644
--- a/src/moapplication.cpp
+++ b/src/moapplication.cpp
@@ -170,12 +170,13 @@ int MOApplication::run(MOMultiProcess& multiProcess)
{
try
{
- // resets things when MO is "restarted"
- resetForRestart();
-
tt.stop();
+
const auto r = doOneRun(multiProcess);
+
if (r == RestartExitCode) {
+ // resets things when MO is "restarted"
+ resetForRestart();
continue;
}
@@ -396,6 +397,10 @@ std::optional<Instance> MOApplication::getCurrentInstance()
if (!currentInstance)
{
+ // clear any overrides that might have been given on the command line
+ m.clearOverrides();
+ m_cl.clear();
+
currentInstance = selectInstance();
}
else
@@ -403,6 +408,10 @@ std::optional<Instance> MOApplication::getCurrentInstance()
if (!QDir(currentInstance->directory()).exists()) {
// the previously used instance doesn't exist anymore
+ // clear any overrides that might have been given on the command line
+ m.clearOverrides();
+ m_cl.clear();
+
if (m.hasAnyInstances()) {
MOShared::criticalOnTop(QObject::tr(
"Instance at '%1' not found. Select another instance.")
@@ -466,6 +475,9 @@ void MOApplication::resetForRestart()
// don't reprocess command line
m_cl.clear();
+
+ // clear instance and profile overrides
+ InstanceManager::singleton().clearOverrides();
}
bool MOApplication::setStyleFile(const QString& styleName)