diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-11-13 16:14:31 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-11-13 16:14:31 +0100 |
| commit | 1facda19438bf01e5b8e08b7ebeb7f3a1c21028f (patch) | |
| tree | bb5b9483c32b781b58ae275e4850fd85596573e0 /src/moapplication.cpp | |
| parent | 4d94ba8dbba20da6d030a8a3adf73d2dbd6fc56f (diff) | |
| parent | 85f515da2d1713bc208d2f1bca4197b91950528a (diff) | |
Merge branch 'master' of github.com:ModOrganizer2/modorganizer into iplugin-isactive-refactoring
Diffstat (limited to 'src/moapplication.cpp')
| -rw-r--r-- | src/moapplication.cpp | 18 |
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)
|
