summaryrefslogtreecommitdiff
path: root/src/yuzu/configuration/configuration_shared.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2023-01-22 01:35:28 -0600
committergerman77 <juangerman-13@hotmail.com>2023-01-22 10:42:59 -0600
commita43646715245a95aa2e75703ca950cc8e4accb92 (patch)
tree38ecf83ae058a1d084824de56c1e2a520de8c604 /src/yuzu/configuration/configuration_shared.cpp
parent380dcde1541bd7b297d5a9c71260a3e42e19af9f (diff)
yuzu: Fix language comobox crash
Diffstat (limited to 'src/yuzu/configuration/configuration_shared.cpp')
-rw-r--r--src/yuzu/configuration/configuration_shared.cpp10
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;
+}