MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / currentInstance

Method currentInstance

src/instancemanager.cpp:514–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514std::unique_ptr<Instance> InstanceManager::currentInstance() const
515{
516 const QString profile = m_overrideProfileName ? *m_overrideProfileName : "";
517
518 const QString name = m_overrideInstanceName ? *m_overrideInstanceName
519 : GlobalSettings::currentInstance();
520
521 if (!allowedToChangeInstance()) {
522 // force portable instance
523 return std::make_unique<Instance>(portablePath(), true, profile);
524 }
525
526 if (name.isEmpty()) {
527 if (portableInstanceExists()) {
528 // use portable
529 return std::make_unique<Instance>(portablePath(), true, profile);
530 } else {
531 // no instance set
532 return {};
533 }
534 }
535
536 return std::make_unique<Instance>(instancePath(name), false, profile);
537}
538
539void InstanceManager::clearCurrentInstance()
540{

Callers 2

isActiveMethod · 0.45
selectInstanceFunction · 0.45

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected