diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-01-22 13:14:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-22 13:14:38 -0500 |
commit | 78df1ddce8853255863adbe14bdfb7abf60319fe (patch) | |
tree | 84b92ac30a0bf7062efab520e8e49f159b39d8cc /src/yuzu/configuration/configuration_shared.cpp | |
parent | 9184b6ed2bbc2547c431fd9453c0de8de5dec3c3 (diff) | |
parent | a43646715245a95aa2e75703ca950cc8e4accb92 (diff) |
Merge pull request #9660 from german77/koreaToTaiwan
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 97fb664bf..ac42cc7fc 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; +} |