From 68e0b5a3f246639564e1c53010bad66845f9677e Mon Sep 17 00:00:00 2001 From: Ali Kianian Date: Wed, 23 Oct 2024 09:27:02 +0300 Subject: [PATCH] StudioWelcome: Fix the bug for the index of the ComboBoxHelper Change-Id: Ic6795ddcc0f25f461bfea212d48ee430d4da672b Reviewed-by: Mahmoud Badri --- src/plugins/studiowelcome/fieldhelper.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/studiowelcome/fieldhelper.cpp b/src/plugins/studiowelcome/fieldhelper.cpp index fea36813d31..d99296c53d2 100644 --- a/src/plugins/studiowelcome/fieldhelper.cpp +++ b/src/plugins/studiowelcome/fieldhelper.cpp @@ -43,16 +43,14 @@ QString ComboBoxHelper::text(int index) const return model->item(index)->text(); } -int ComboBoxHelper::indexOf(const QString &) const +int ComboBoxHelper::indexOf(const QString &text) const { QTC_ASSERT(m_field, return -1); const QStandardItemModel *model = m_field->model(); for (int i = 0; i < model->rowCount(); ++i) { const QStandardItem *item = model->item(i, 0); - const QString text = item->text(); - - if (text == text) + if (text == item->text()) return i; }