MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / switchProfile

Method switchProfile

pcsx2-qt/Settings/ControllerSettingsWindow.cpp:576–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576void ControllerSettingsWindow::switchProfile(const QString& name)
577{
578 QSignalBlocker sb(m_ui.currentProfile);
579
580 if (!name.isEmpty())
581 {
582 std::string path(VMManager::GetInputProfilePath(name.toStdString()));
583 if (!FileSystem::FileExists(path.c_str()))
584 {
585 QMessageBox::critical(this, tr("Error"), tr("The input profile named '%1' cannot be found.").arg(name));
586 return;
587 }
588
589 std::unique_ptr<INISettingsInterface> sif(std::make_unique<INISettingsInterface>(std::move(path)));
590 sif->Load();
591 m_profile_interface = std::move(sif);
592 m_ui.currentProfile->setCurrentIndex(m_ui.currentProfile->findText(name));
593 }
594 else
595 {
596 m_profile_interface.reset();
597 m_ui.currentProfile->setCurrentIndex(0);
598 }
599
600 m_profile_name = name;
601 createWidgets();
602}
603
604#include "moc_ControllerSettingsWindow.cpp"

Callers

nothing calls this directly

Calls 5

argMethod · 0.80
isEmptyMethod · 0.45
c_strMethod · 0.45
LoadMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected