diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-02-22 03:09:03 +0100 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-02-22 03:09:03 +0100 |
| commit | 2082ba7ec7733dc1c8de57d48161b55279c6610f (patch) | |
| tree | 41fc03a9f8a3e705567d224fa25e56097c67dae3 /src/yuzu/configuration | |
| parent | bfc720152a389c8110c814f600125ccf480075ac (diff) | |
[cmake, common] allow build with -fno-rtti and /GR-, to disable gen of rtti and save some bytes in vtables (#359)
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/359
Reviewed-by: DraVee <dravee@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/yuzu/configuration')
| -rw-r--r-- | src/yuzu/configuration/shared_widget.cpp | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp index 2d76a774f6..b663ac51ee 100644 --- a/src/yuzu/configuration/shared_widget.cpp +++ b/src/yuzu/configuration/shared_widget.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project @@ -505,7 +505,7 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu RequestType request, float multiplier, Settings::BasicSetting* other_setting, const QString& suffix) { created = true; - const auto type = setting.TypeId(); + const auto type_id = setting.TypeId(); QHBoxLayout* layout = new QHBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); @@ -514,10 +514,8 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu other_setting = setting.PairedSetting(); } - const bool require_checkbox = - other_setting != nullptr && other_setting->TypeId() == typeid(bool); - - if (other_setting != nullptr && other_setting->TypeId() != typeid(bool)) { + const bool require_checkbox = other_setting != nullptr && other_setting->TypeId() == "bool"; + if (other_setting != nullptr && other_setting->TypeId() != "bool") { LOG_WARNING( Frontend, "Extra setting \"{}\" specified but is not bool, refusing to create checkbox for it.", @@ -572,16 +570,27 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu } if (require_checkbox) { - QWidget* lhs = - CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch); + QWidget* lhs = CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch); layout->addWidget(lhs, 1); - } else if (setting.TypeId() != typeid(bool)) { + } else if (type_id != "bool") { QLabel* qt_label = CreateLabel(label); layout->addWidget(qt_label, 1); } - if (setting.TypeId() == typeid(bool)) { + if (type_id == "bool") { data_component = CreateCheckBox(&setting, label, serializer, restore_func, touch); + } else if (type_id == "string") { + switch (request) { + case RequestType::Default: + case RequestType::LineEdit: + data_component = CreateLineEdit(serializer, restore_func, touch); + break; + case RequestType::ComboBox: + data_component = CreateCombobox(serializer, restore_func, touch); + break; + default: + UNIMPLEMENTED(); + } } else if (setting.IsEnum()) { if (request == RequestType::RadioGroup) { data_component = CreateRadioGroup(serializer, restore_func, touch); @@ -629,18 +638,6 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu default: UNIMPLEMENTED(); } - } else if (type == typeid(std::string)) { - switch (request) { - case RequestType::Default: - case RequestType::LineEdit: - data_component = CreateLineEdit(serializer, restore_func, touch); - break; - case RequestType::ComboBox: - data_component = CreateCombobox(serializer, restore_func, touch); - break; - default: - UNIMPLEMENTED(); - } } if (data_component == nullptr) { |
