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

Method openSelectedInstance

src/instancemanagerdialog.cpp:354–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354void InstanceManagerDialog::openSelectedInstance()
355{
356 const auto i = singleSelectionIndex();
357 if (i == NoSelection) {
358 return;
359 }
360
361 const auto& to = *m_instances[i];
362
363 if (!confirmSwitch(to)) {
364 return;
365 }
366
367 if (to.isPortable()) {
368 InstanceManager::singleton().setCurrentInstance("");
369 } else {
370 InstanceManager::singleton().setCurrentInstance(to.displayName());
371 }
372
373 if (m_restartOnSelect) {
374 ExitModOrganizer(Exit::Restart);
375 }
376
377 accept();
378}
379
380bool InstanceManagerDialog::confirmSwitch(const Instance& to)
381{

Callers

nothing calls this directly

Calls 4

ExitModOrganizerFunction · 0.85
isPortableMethod · 0.80
setCurrentInstanceMethod · 0.45
displayNameMethod · 0.45

Tested by

no test coverage detected