diff options
| author | german77 <juangerman-13@hotmail.com> | 2023-01-22 01:35:28 -0600 |
|---|---|---|
| committer | german77 <juangerman-13@hotmail.com> | 2023-01-22 10:42:59 -0600 |
| commit | 8137de5e9355c290d060f211a7982cafdf4019a6 (patch) | |
| tree | 38ecf83ae058a1d084824de56c1e2a520de8c604 /src/yuzu/configuration/configuration_shared.cpp | |
| parent | 9b6fe96442b0ab1f55622f698ee5361bcb2c8c18 (diff) | |
yuzu: Fix language comobox crash
Diffstat (limited to 'src/yuzu/configuration/configuration_shared.cpp')
| -rw-r--r-- | src/yuzu/configuration/configuration_shared.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index 97fb664bf2..ac42cc7fc2 100644 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp @@ -92,3 +92,13 @@ void ConfigurationShared::InsertGlobalItem(QComboBox* combobox, int global_index combobox->insertItem(ConfigurationShared::USE_GLOBAL_INDEX, use_global_text); combobox->insertSeparator(ConfigurationShared::USE_GLOBAL_SEPARATOR_INDEX); } + +int ConfigurationShared::GetComboboxIndex(int global_setting_index, const QComboBox* combobox) { + if (Settings::IsConfiguringGlobal()) { + return combobox->currentIndex(); + } + if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { + return global_setting_index; + } + return combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET; +} |
