yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

common,qt-config: Remove usage of forward_list

This commit is contained in:
lat9nq 2023-07-21 23:09:09 -04:00
parent 2911988b85
commit 17b9c1e171
21 changed files with 64 additions and 65 deletions

View File

@ -10,7 +10,6 @@
#include <compare> #include <compare>
#include <cstddef> #include <cstddef>
#include <filesystem> #include <filesystem>
#include <forward_list>
#include <functional> #include <functional>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>

View File

@ -3,7 +3,6 @@
#pragma once #pragma once
#include <forward_list>
#include <functional> #include <functional>
#include <map> #include <map>
#include <string> #include <string>

View File

@ -3,13 +3,14 @@
#include <memory> #include <memory>
#include <type_traits> #include <type_traits>
#include <vector>
#include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configuration_shared.h"
namespace ConfigurationShared { namespace ConfigurationShared {
Tab::Tab(std::shared_ptr<std::forward_list<Tab*>> group, QWidget* parent) : QWidget(parent) { Tab::Tab(std::shared_ptr<std::vector<Tab*>> group, QWidget* parent) : QWidget(parent) {
if (group != nullptr) { if (group != nullptr) {
group->push_front(this); group->push_back(this);
} }
} }

View File

@ -3,8 +3,8 @@
#pragma once #pragma once
#include <forward_list>
#include <memory> #include <memory>
#include <vector>
#include <QString> #include <QString>
#include <QWidget> #include <QWidget>
#include <qobjectdefs.h> #include <qobjectdefs.h>
@ -17,7 +17,7 @@ class Tab : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit Tab(std::shared_ptr<std::forward_list<Tab*>> group, QWidget* parent = nullptr); explicit Tab(std::shared_ptr<std::vector<Tab*>> group, QWidget* parent = nullptr);
~Tab(); ~Tab();
virtual void ApplyConfiguration() = 0; virtual void ApplyConfiguration() = 0;

View File

@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <forward_list>
#include <memory> #include <memory>
#include <vector>
#include <QComboBox> #include <QComboBox>
#include "audio_core/sink/sink.h" #include "audio_core/sink/sink.h"
@ -17,7 +17,7 @@
#include "yuzu/uisettings.h" #include "yuzu/uisettings.h"
ConfigureAudio::ConfigureAudio(const Core::System& system_, ConfigureAudio::ConfigureAudio(const Core::System& system_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
const ConfigurationShared::Builder& builder, QWidget* parent) const ConfigurationShared::Builder& builder, QWidget* parent)
: Tab(group_, parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} { : Tab(group_, parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} {
ui->setupUi(this); ui->setupUi(this);
@ -31,11 +31,11 @@ ConfigureAudio::~ConfigureAudio() = default;
void ConfigureAudio::Setup(const ConfigurationShared::Builder& builder) { void ConfigureAudio::Setup(const ConfigurationShared::Builder& builder) {
auto& layout = *ui->audio_widget->layout(); auto& layout = *ui->audio_widget->layout();
std::forward_list<Settings::BasicSetting*> settings; std::vector<Settings::BasicSetting*> settings;
auto push = [&](Settings::Category category) { auto push = [&](Settings::Category category) {
for (auto* setting : Settings::values.linkage.by_category[category]) { for (auto* setting : Settings::values.linkage.by_category[category]) {
settings.push_front(setting); settings.push_back(setting);
} }
}; };

View File

@ -3,9 +3,9 @@
#pragma once #pragma once
#include <forward_list>
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <vector>
#include <QWidget> #include <QWidget>
#include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configuration_shared.h"
@ -26,7 +26,7 @@ class Builder;
class ConfigureAudio : public ConfigurationShared::Tab { class ConfigureAudio : public ConfigurationShared::Tab {
public: public:
explicit ConfigureAudio(const Core::System& system_, explicit ConfigureAudio(const Core::System& system_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
const ConfigurationShared::Builder& builder, QWidget* parent = nullptr); const ConfigurationShared::Builder& builder, QWidget* parent = nullptr);
~ConfigureAudio() override; ~ConfigureAudio() override;
@ -51,7 +51,7 @@ private:
const Core::System& system; const Core::System& system;
std::forward_list<std::function<void(bool)>> apply_funcs{}; std::vector<std::function<void(bool)>> apply_funcs{};
QComboBox* sink_combo_box; QComboBox* sink_combo_box;
QComboBox* output_device_combo_box; QComboBox* output_device_combo_box;

View File

@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <forward_list>
#include <memory> #include <memory>
#include <typeinfo> #include <typeinfo>
#include <vector>
#include <QComboBox> #include <QComboBox>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/settings.h" #include "common/settings.h"
@ -15,7 +15,7 @@
#include "yuzu/configuration/configure_cpu.h" #include "yuzu/configuration/configure_cpu.h"
ConfigureCpu::ConfigureCpu(const Core::System& system_, ConfigureCpu::ConfigureCpu(const Core::System& system_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
const ConfigurationShared::Builder& builder, QWidget* parent) const ConfigurationShared::Builder& builder, QWidget* parent)
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureCpu>()}, system{system_}, : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureCpu>()}, system{system_},
combobox_translations(builder.ComboboxTranslations()) { combobox_translations(builder.ComboboxTranslations()) {
@ -37,10 +37,10 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
auto* unsafe_layout = ui->unsafe_widget->layout(); auto* unsafe_layout = ui->unsafe_widget->layout();
std::map<std::string, QWidget*> unsafe_hold{}; std::map<std::string, QWidget*> unsafe_hold{};
std::forward_list<Settings::BasicSetting*> settings; std::vector<Settings::BasicSetting*> settings;
const auto push = [&](Settings::Category category) { const auto push = [&](Settings::Category category) {
for (const auto setting : Settings::values.linkage.by_category[category]) { for (const auto setting : Settings::values.linkage.by_category[category]) {
settings.push_front(setting); settings.push_back(setting);
} }
}; };

View File

@ -4,6 +4,7 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <vector>
#include <QWidget> #include <QWidget>
#include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/shared_translation.h" #include "yuzu/configuration/shared_translation.h"
@ -25,7 +26,7 @@ class Builder;
class ConfigureCpu : public ConfigurationShared::Tab { class ConfigureCpu : public ConfigurationShared::Tab {
public: public:
explicit ConfigureCpu(const Core::System& system_, explicit ConfigureCpu(const Core::System& system_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
const ConfigurationShared::Builder& builder, QWidget* parent = nullptr); const ConfigurationShared::Builder& builder, QWidget* parent = nullptr);
~ConfigureCpu() override; ~ConfigureCpu() override;
@ -45,7 +46,7 @@ private:
const Core::System& system; const Core::System& system;
const ConfigurationShared::ComboboxTranslationMap& combobox_translations; const ConfigurationShared::ComboboxTranslationMap& combobox_translations;
std::forward_list<std::function<void(bool)>> apply_funcs{}; std::vector<std::function<void(bool)>> apply_funcs{};
QComboBox* accuracy_combobox; QComboBox* accuracy_combobox;
}; };

View File

@ -3,7 +3,6 @@
#pragma once #pragma once
#include <forward_list>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <QDialog> #include <QDialog>
@ -74,7 +73,7 @@ private:
Core::System& system; Core::System& system;
std::unique_ptr<ConfigurationShared::Builder> builder; std::unique_ptr<ConfigurationShared::Builder> builder;
std::forward_list<ConfigurationShared::Tab*> tab_group; std::vector<ConfigurationShared::Tab*> tab_group;
std::unique_ptr<ConfigureAudio> audio_tab; std::unique_ptr<ConfigureAudio> audio_tab;
std::unique_ptr<ConfigureCpu> cpu_tab; std::unique_ptr<ConfigureCpu> cpu_tab;

View File

@ -3,6 +3,7 @@
#include <functional> #include <functional>
#include <utility> #include <utility>
#include <vector>
#include <QMessageBox> #include <QMessageBox>
#include "common/settings.h" #include "common/settings.h"
#include "core/core.h" #include "core/core.h"
@ -12,10 +13,9 @@
#include "yuzu/configuration/shared_widget.h" #include "yuzu/configuration/shared_widget.h"
#include "yuzu/uisettings.h" #include "yuzu/uisettings.h"
ConfigureGeneral::ConfigureGeneral( ConfigureGeneral::ConfigureGeneral(const Core::System& system_,
const Core::System& system_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, const ConfigurationShared::Builder& builder, QWidget* parent)
const ConfigurationShared::Builder& builder, QWidget* parent)
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGeneral>()}, system{system_} { : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGeneral>()}, system{system_} {
ui->setupUi(this); ui->setupUi(this);

View File

@ -5,6 +5,7 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <vector>
#include <QWidget> #include <QWidget>
#include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configuration_shared.h"
@ -26,7 +27,7 @@ class Builder;
class ConfigureGeneral : public ConfigurationShared::Tab { class ConfigureGeneral : public ConfigurationShared::Tab {
public: public:
explicit ConfigureGeneral(const Core::System& system_, explicit ConfigureGeneral(const Core::System& system_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
const ConfigurationShared::Builder& builder, const ConfigurationShared::Builder& builder,
QWidget* parent = nullptr); QWidget* parent = nullptr);
~ConfigureGeneral() override; ~ConfigureGeneral() override;
@ -46,7 +47,7 @@ private:
std::unique_ptr<Ui::ConfigureGeneral> ui; std::unique_ptr<Ui::ConfigureGeneral> ui;
std::forward_list<std::function<void(bool)>> apply_funcs{}; std::vector<std::function<void(bool)>> apply_funcs{};
const Core::System& system; const Core::System& system;
}; };

View File

@ -77,11 +77,11 @@ static constexpr Settings::VSyncMode PresentModeToSetting(VkPresentModeKHR mode)
} }
} }
ConfigureGraphics::ConfigureGraphics( ConfigureGraphics::ConfigureGraphics(const Core::System& system_,
const Core::System& system_, std::vector<VkDeviceInfo::Record>& records_, std::vector<VkDeviceInfo::Record>& records_,
const std::function<void()>& expose_compute_option_, const std::function<void()>& expose_compute_option_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
const ConfigurationShared::Builder& builder, QWidget* parent) const ConfigurationShared::Builder& builder, QWidget* parent)
: ConfigurationShared::Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, : ConfigurationShared::Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphics>()},
records{records_}, expose_compute_option{expose_compute_option_}, system{system_}, records{records_}, expose_compute_option{expose_compute_option_}, system{system_},
combobox_translations{builder.ComboboxTranslations()}, combobox_translations{builder.ComboboxTranslations()},
@ -228,7 +228,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
QLayout& graphics_layout = *ui->graphics_widget->layout(); QLayout& graphics_layout = *ui->graphics_widget->layout();
std::map<u32, QWidget*> hold_graphics; std::map<u32, QWidget*> hold_graphics;
std::forward_list<QWidget*> hold_api; std::vector<QWidget*> hold_api;
for (const auto setting : Settings::values.linkage.by_category[Settings::Category::Renderer]) { for (const auto setting : Settings::values.linkage.by_category[Settings::Category::Renderer]) {
ConfigurationShared::Widget* widget = [&]() { ConfigurationShared::Widget* widget = [&]() {
@ -268,12 +268,12 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
} }
} else if (setting->Id() == Settings::values.vulkan_device.Id()) { } else if (setting->Id() == Settings::values.vulkan_device.Id()) {
// Keep track of vulkan_device's combobox so we can populate it // Keep track of vulkan_device's combobox so we can populate it
hold_api.push_front(widget); hold_api.push_back(widget);
vulkan_device_combobox = widget->combobox; vulkan_device_combobox = widget->combobox;
vulkan_device_widget = widget; vulkan_device_widget = widget;
} else if (setting->Id() == Settings::values.shader_backend.Id()) { } else if (setting->Id() == Settings::values.shader_backend.Id()) {
// Keep track of shader_backend's combobox so we can populate it // Keep track of shader_backend's combobox so we can populate it
hold_api.push_front(widget); hold_api.push_back(widget);
shader_backend_combobox = widget->combobox; shader_backend_combobox = widget->combobox;
shader_backend_widget = widget; shader_backend_widget = widget;
} else if (setting->Id() == Settings::values.vsync_mode.Id()) { } else if (setting->Id() == Settings::values.vsync_mode.Id()) {
@ -296,7 +296,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
// Background color is too specific to build into the new system, so we manage it here // Background color is too specific to build into the new system, so we manage it here
// (3 settings, all collected into a single widget with a QColor to manage on top) // (3 settings, all collected into a single widget with a QColor to manage on top)
if (Settings::IsConfiguringGlobal()) { if (Settings::IsConfiguringGlobal()) {
apply_funcs.push_front([this](bool powered_on) { apply_funcs.push_back([this](bool powered_on) {
Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red())); Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red()));
Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green())); Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green()));
Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue())); Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue()));
@ -322,7 +322,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
bg_restore_button->setEnabled(true); bg_restore_button->setEnabled(true);
}); });
apply_funcs.push_front([bg_restore_button, this](bool powered_on) { apply_funcs.push_back([bg_restore_button, this](bool powered_on) {
const bool using_global = !bg_restore_button->isEnabled(); const bool using_global = !bg_restore_button->isEnabled();
Settings::values.bg_red.SetGlobal(using_global); Settings::values.bg_red.SetGlobal(using_global);
Settings::values.bg_green.SetGlobal(using_global); Settings::values.bg_green.SetGlobal(using_global);

View File

@ -46,7 +46,7 @@ public:
explicit ConfigureGraphics(const Core::System& system_, explicit ConfigureGraphics(const Core::System& system_,
std::vector<VkDeviceInfo::Record>& records, std::vector<VkDeviceInfo::Record>& records,
const std::function<void()>& expose_compute_option_, const std::function<void()>& expose_compute_option_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
const ConfigurationShared::Builder& builder, const ConfigurationShared::Builder& builder,
QWidget* parent = nullptr); QWidget* parent = nullptr);
~ConfigureGraphics() override; ~ConfigureGraphics() override;
@ -80,7 +80,7 @@ private:
std::unique_ptr<Ui::ConfigureGraphics> ui; std::unique_ptr<Ui::ConfigureGraphics> ui;
QColor bg_color; QColor bg_color;
std::forward_list<std::function<void(bool)>> apply_funcs{}; std::vector<std::function<void(bool)>> apply_funcs{};
std::vector<VkDeviceInfo::Record>& records; std::vector<VkDeviceInfo::Record>& records;
std::vector<QString> vulkan_devices; std::vector<QString> vulkan_devices;

View File

@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <vector>
#include <QLabel> #include <QLabel>
#include <qnamespace.h> #include <qnamespace.h>
#include "common/settings.h" #include "common/settings.h"
@ -12,8 +13,7 @@
#include "yuzu/configuration/shared_widget.h" #include "yuzu/configuration/shared_widget.h"
ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced( ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(
const Core::System& system_, const Core::System& system_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_,
const ConfigurationShared::Builder& builder, QWidget* parent) const ConfigurationShared::Builder& builder, QWidget* parent)
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_} { : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_} {

View File

@ -4,6 +4,7 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <vector>
#include <QWidget> #include <QWidget>
#include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configuration_shared.h"
@ -22,8 +23,7 @@ class Builder;
class ConfigureGraphicsAdvanced : public ConfigurationShared::Tab { class ConfigureGraphicsAdvanced : public ConfigurationShared::Tab {
public: public:
explicit ConfigureGraphicsAdvanced( explicit ConfigureGraphicsAdvanced(
const Core::System& system_, const Core::System& system_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group,
const ConfigurationShared::Builder& builder, QWidget* parent = nullptr); const ConfigurationShared::Builder& builder, QWidget* parent = nullptr);
~ConfigureGraphicsAdvanced() override; ~ConfigureGraphicsAdvanced() override;
@ -41,7 +41,7 @@ private:
const Core::System& system; const Core::System& system;
std::forward_list<std::function<void(bool)>> apply_funcs; std::vector<std::function<void(bool)>> apply_funcs;
QWidget* checkbox_enable_compute_pipelines{}; QWidget* checkbox_enable_compute_pipelines{};
}; };

View File

@ -44,7 +44,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st
: QDialog(parent), : QDialog(parent),
ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_}, ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_},
builder{std::make_unique<ConfigurationShared::Builder>(this, !system_.IsPoweredOn())}, builder{std::make_unique<ConfigurationShared::Builder>(this, !system_.IsPoweredOn())},
tab_group{std::make_shared<std::forward_list<ConfigurationShared::Tab*>>()} { tab_group{std::make_shared<std::vector<ConfigurationShared::Tab*>>()} {
const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name));
const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename())
: fmt::format("{:016X}", title_id); : fmt::format("{:016X}", title_id);

View File

@ -3,7 +3,6 @@
#pragma once #pragma once
#include <forward_list>
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
@ -77,7 +76,7 @@ private:
Core::System& system; Core::System& system;
std::unique_ptr<ConfigurationShared::Builder> builder; std::unique_ptr<ConfigurationShared::Builder> builder;
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> tab_group; std::shared_ptr<std::vector<ConfigurationShared::Tab*>> tab_group;
std::unique_ptr<ConfigurePerGameAddons> addons_tab; std::unique_ptr<ConfigurePerGameAddons> addons_tab;
std::unique_ptr<ConfigureAudio> audio_tab; std::unique_ptr<ConfigureAudio> audio_tab;

View File

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <chrono> #include <chrono>
#include <forward_list>
#include <optional> #include <optional>
#include <vector>
#include <QCheckBox> #include <QCheckBox>
#include <QComboBox> #include <QComboBox>
@ -44,9 +44,9 @@ static bool IsValidLocale(u32 region_index, u32 language_index) {
return ((LOCALE_BLOCKLIST.at(region_index) >> language_index) & 1) == 0; return ((LOCALE_BLOCKLIST.at(region_index) >> language_index) & 1) == 0;
} }
ConfigureSystem::ConfigureSystem( ConfigureSystem::ConfigureSystem(Core::System& system_,
Core::System& system_, std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
const ConfigurationShared::Builder& builder, QWidget* parent) const ConfigurationShared::Builder& builder, QWidget* parent)
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} { : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} {
ui->setupUi(this); ui->setupUi(this);
@ -95,10 +95,10 @@ void ConfigureSystem::Setup(const ConfigurationShared::Builder& builder) {
std::map<u32, QWidget*> core_hold{}; std::map<u32, QWidget*> core_hold{};
std::map<u32, QWidget*> system_hold{}; std::map<u32, QWidget*> system_hold{};
std::forward_list<Settings::BasicSetting*> settings; std::vector<Settings::BasicSetting*> settings;
auto push = [&settings](auto& list) { auto push = [&settings](auto& list) {
for (auto setting : list) { for (auto setting : list) {
settings.push_front(setting); settings.push_back(setting);
} }
}; };

View File

@ -3,9 +3,9 @@
#pragma once #pragma once
#include <forward_list>
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <vector>
#include <QWidget> #include <QWidget>
#include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configuration_shared.h"
@ -29,7 +29,7 @@ class Builder;
class ConfigureSystem : public ConfigurationShared::Tab { class ConfigureSystem : public ConfigurationShared::Tab {
public: public:
explicit ConfigureSystem(Core::System& system_, explicit ConfigureSystem(Core::System& system_,
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
const ConfigurationShared::Builder& builder, const ConfigurationShared::Builder& builder,
QWidget* parent = nullptr); QWidget* parent = nullptr);
~ConfigureSystem() override; ~ConfigureSystem() override;
@ -43,7 +43,7 @@ private:
void Setup(const ConfigurationShared::Builder& builder); void Setup(const ConfigurationShared::Builder& builder);
std::forward_list<std::function<void(bool)>> apply_funcs{}; std::vector<std::function<void(bool)>> apply_funcs{};
std::unique_ptr<Ui::ConfigureSystem> ui; std::unique_ptr<Ui::ConfigureSystem> ui;
bool enabled = false; bool enabled = false;

View File

@ -547,7 +547,7 @@ Widget::~Widget() = default;
Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translations_, Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translations_,
const ComboboxTranslationMap& combobox_translations_, QWidget* parent_, const ComboboxTranslationMap& combobox_translations_, QWidget* parent_,
bool runtime_lock_, std::forward_list<std::function<void(bool)>>& apply_funcs_, bool runtime_lock_, std::vector<std::function<void(bool)>>& apply_funcs_,
RequestType request, bool managed, float multiplier, RequestType request, bool managed, float multiplier,
Settings::BasicSetting* other_setting, const QString& suffix) Settings::BasicSetting* other_setting, const QString& suffix)
: QWidget(parent_), parent{parent_}, translations{translations_}, : QWidget(parent_), parent{parent_}, translations{translations_},
@ -584,7 +584,7 @@ Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translati
return; return;
} }
apply_funcs.push_front([load_func, setting_](bool powered_on) { apply_funcs.push_back([load_func, setting_](bool powered_on) {
if (setting_->RuntimeModfiable() || !powered_on) { if (setting_->RuntimeModfiable() || !powered_on) {
load_func(); load_func();
} }
@ -607,7 +607,7 @@ Builder::Builder(QWidget* parent_, bool runtime_lock_)
Builder::~Builder() = default; Builder::~Builder() = default;
Widget* Builder::BuildWidget(Settings::BasicSetting* setting, Widget* Builder::BuildWidget(Settings::BasicSetting* setting,
std::forward_list<std::function<void(bool)>>& apply_funcs, std::vector<std::function<void(bool)>>& apply_funcs,
RequestType request, bool managed, float multiplier, RequestType request, bool managed, float multiplier,
Settings::BasicSetting* other_setting, const QString& suffix) const { Settings::BasicSetting* other_setting, const QString& suffix) const {
if (!Settings::IsConfiguringGlobal() && !setting->Switchable()) { if (!Settings::IsConfiguringGlobal() && !setting->Switchable()) {
@ -624,7 +624,7 @@ Widget* Builder::BuildWidget(Settings::BasicSetting* setting,
} }
Widget* Builder::BuildWidget(Settings::BasicSetting* setting, Widget* Builder::BuildWidget(Settings::BasicSetting* setting,
std::forward_list<std::function<void(bool)>>& apply_funcs, std::vector<std::function<void(bool)>>& apply_funcs,
Settings::BasicSetting* other_setting, RequestType request, Settings::BasicSetting* other_setting, RequestType request,
const QString& suffix) const { const QString& suffix) const {
return BuildWidget(setting, apply_funcs, request, true, 1.0f, other_setting, suffix); return BuildWidget(setting, apply_funcs, request, true, 1.0f, other_setting, suffix);

View File

@ -3,10 +3,10 @@
#pragma once #pragma once
#include <forward_list>
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector>
#include <QString> #include <QString>
#include <QStringLiteral> #include <QStringLiteral>
#include <QWidget> #include <QWidget>
@ -62,7 +62,7 @@ public:
*/ */
explicit Widget(Settings::BasicSetting* setting, const TranslationMap& translations, explicit Widget(Settings::BasicSetting* setting, const TranslationMap& translations,
const ComboboxTranslationMap& combobox_translations, QWidget* parent, const ComboboxTranslationMap& combobox_translations, QWidget* parent,
bool runtime_lock, std::forward_list<std::function<void(bool)>>& apply_funcs_, bool runtime_lock, std::vector<std::function<void(bool)>>& apply_funcs_,
RequestType request = RequestType::Default, bool managed = true, RequestType request = RequestType::Default, bool managed = true,
float multiplier = 1.0f, Settings::BasicSetting* other_setting = nullptr, float multiplier = 1.0f, Settings::BasicSetting* other_setting = nullptr,
const QString& suffix = QStringLiteral("")); const QString& suffix = QStringLiteral(""));
@ -125,7 +125,7 @@ private:
const TranslationMap& translations; const TranslationMap& translations;
const ComboboxTranslationMap& combobox_enumerations; const ComboboxTranslationMap& combobox_enumerations;
Settings::BasicSetting& setting; Settings::BasicSetting& setting;
std::forward_list<std::function<void(bool)>>& apply_funcs; std::vector<std::function<void(bool)>>& apply_funcs;
bool created{false}; bool created{false};
bool runtime_lock{false}; bool runtime_lock{false};
@ -137,13 +137,13 @@ public:
~Builder(); ~Builder();
Widget* BuildWidget(Settings::BasicSetting* setting, Widget* BuildWidget(Settings::BasicSetting* setting,
std::forward_list<std::function<void(bool)>>& apply_funcs, std::vector<std::function<void(bool)>>& apply_funcs,
RequestType request = RequestType::Default, bool managed = true, RequestType request = RequestType::Default, bool managed = true,
float multiplier = 1.0f, Settings::BasicSetting* other_setting = nullptr, float multiplier = 1.0f, Settings::BasicSetting* other_setting = nullptr,
const QString& suffix = QStringLiteral("")) const; const QString& suffix = QStringLiteral("")) const;
Widget* BuildWidget(Settings::BasicSetting* setting, Widget* BuildWidget(Settings::BasicSetting* setting,
std::forward_list<std::function<void(bool)>>& apply_funcs, std::vector<std::function<void(bool)>>& apply_funcs,
Settings::BasicSetting* other_setting, Settings::BasicSetting* other_setting,
RequestType request = RequestType::Default, RequestType request = RequestType::Default,
const QString& suffix = QStringLiteral("")) const; const QString& suffix = QStringLiteral("")) const;