mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge pull request #10332 from AdmiralCurtiss/config-port-general
Config: Port remaining General settings to new config system.
This commit is contained in:
@ -758,15 +758,15 @@ void MenuBar::AddMovieMenu()
|
||||
|
||||
auto* lag_counter = movie_menu->addAction(tr("Show Lag Counter"));
|
||||
lag_counter->setCheckable(true);
|
||||
lag_counter->setChecked(SConfig::GetInstance().m_ShowLag);
|
||||
lag_counter->setChecked(Config::Get(Config::MAIN_SHOW_LAG));
|
||||
connect(lag_counter, &QAction::toggled,
|
||||
[](bool value) { SConfig::GetInstance().m_ShowLag = value; });
|
||||
[](bool value) { Config::SetBaseOrCurrent(Config::MAIN_SHOW_LAG, value); });
|
||||
|
||||
auto* frame_counter = movie_menu->addAction(tr("Show Frame Counter"));
|
||||
frame_counter->setCheckable(true);
|
||||
frame_counter->setChecked(SConfig::GetInstance().m_ShowFrameCount);
|
||||
frame_counter->setChecked(Config::Get(Config::MAIN_SHOW_FRAME_COUNT));
|
||||
connect(frame_counter, &QAction::toggled,
|
||||
[](bool value) { SConfig::GetInstance().m_ShowFrameCount = value; });
|
||||
[](bool value) { Config::SetBaseOrCurrent(Config::MAIN_SHOW_FRAME_COUNT, value); });
|
||||
|
||||
auto* input_display = movie_menu->addAction(tr("Show Input Display"));
|
||||
input_display->setCheckable(true);
|
||||
|
@ -216,7 +216,7 @@ void Settings::GetToolTipStyle(QColor& window_color, QColor& text_color,
|
||||
QStringList Settings::GetPaths() const
|
||||
{
|
||||
QStringList list;
|
||||
for (const auto& path : SConfig::GetInstance().m_ISOFolder)
|
||||
for (const auto& path : Config::GetIsoPaths())
|
||||
list << QString::fromStdString(path);
|
||||
return list;
|
||||
}
|
||||
@ -224,25 +224,27 @@ QStringList Settings::GetPaths() const
|
||||
void Settings::AddPath(const QString& qpath)
|
||||
{
|
||||
std::string path = qpath.toStdString();
|
||||
std::vector<std::string> paths = Config::GetIsoPaths();
|
||||
|
||||
std::vector<std::string>& paths = SConfig::GetInstance().m_ISOFolder;
|
||||
if (std::find(paths.begin(), paths.end(), path) != paths.end())
|
||||
return;
|
||||
|
||||
paths.emplace_back(path);
|
||||
Config::SetIsoPaths(paths);
|
||||
emit PathAdded(qpath);
|
||||
}
|
||||
|
||||
void Settings::RemovePath(const QString& qpath)
|
||||
{
|
||||
std::string path = qpath.toStdString();
|
||||
std::vector<std::string>& paths = SConfig::GetInstance().m_ISOFolder;
|
||||
std::vector<std::string> paths = Config::GetIsoPaths();
|
||||
|
||||
auto new_end = std::remove(paths.begin(), paths.end(), path);
|
||||
if (new_end == paths.end())
|
||||
return;
|
||||
|
||||
paths.erase(new_end, paths.end());
|
||||
Config::SetIsoPaths(paths);
|
||||
emit PathRemoved(qpath);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user