diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-10 22:06:38 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-18 08:20:07 -0500 |
| commit | 3bca0e761597f590fa3b1c6a57ee325e774e3f49 (patch) | |
| tree | 34a49c4754a26073a59f658b905b5cdae72e2235 /src/instancemanager.cpp | |
| parent | 59f055ba93381b965cdc04557ac1dce2df36bd07 (diff) | |
split run() into setup() and run()
this is so command line processing can happen outside of MOApplication
many important objects were local to run(), so they're not members of MOApplication instead
Diffstat (limited to 'src/instancemanager.cpp')
| -rw-r--r-- | src/instancemanager.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp index 18604bf1..a9905b75 100644 --- a/src/instancemanager.cpp +++ b/src/instancemanager.cpp @@ -544,7 +544,7 @@ void InstanceManager::clearOverrides() m_overrideProfileName = {}; } -std::optional<Instance> InstanceManager::currentInstance() const +std::unique_ptr<Instance> InstanceManager::currentInstance() const { const QString profile = m_overrideProfileName ? *m_overrideProfileName : ""; @@ -555,20 +555,20 @@ std::optional<Instance> InstanceManager::currentInstance() const if (!allowedToChangeInstance()) { // force portable instance - return Instance(portablePath(), true, profile); + return std::make_unique<Instance>(portablePath(), true, profile); } if (name.isEmpty()) { if (portableInstanceExists()) { // use portable - return Instance(portablePath(), true, profile); + return std::make_unique<Instance>(portablePath(), true, profile); } else { // no instance set return {}; } } - return Instance(instancePath(name), false, profile); + return std::make_unique<Instance>(instancePath(name), false, profile); } void InstanceManager::clearCurrentInstance() @@ -772,7 +772,7 @@ bool InstanceManager::validInstanceName(const QString& instanceName) const -std::optional<Instance> selectInstance() +std::unique_ptr<Instance> selectInstance() { auto& m = InstanceManager::singleton(); |
