From 4e75e57775e4acd09bfbe4b30a1bc07cea4bcf5c Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Tue, 31 Jan 2023 09:28:56 +0800 Subject: [PATCH] Fix the problem that the fuzzy search button is not displayed when the index switch is turned on by ask dialog. --- search-ukcc-plugin/search.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/search-ukcc-plugin/search.cpp b/search-ukcc-plugin/search.cpp index c26a849..bcb33bf 100644 --- a/search-ukcc-plugin/search.cpp +++ b/search-ukcc-plugin/search.cpp @@ -95,10 +95,15 @@ QWidget *Search::pluginUi() //监听gsettings值改变,更新控制面板UI connect(m_gsettings, &QGSettings::changed, this, [ = ](const QString &key) { if (key == SEARCH_METHOD_KEY) { - bool is_index_search_on = m_gsettings->get(SEARCH_METHOD_KEY).toBool(); + bool isIndexSearchOn = m_gsettings->get(SEARCH_METHOD_KEY).toBool(); m_searchMethodBtn->blockSignals(true); - m_searchMethodBtn->setChecked(is_index_search_on); + m_searchMethodBtn->setChecked(isIndexSearchOn); m_searchMethodBtn->blockSignals(false); + if (isIndexSearchOn) { + m_indexSetFrame->show(); + } else { + m_indexSetFrame->hide(); + } } else if (key == WEB_ENGINE_KEY) { QString engine = m_gsettings->get(WEB_ENGINE_KEY).toString(); m_webEngineFrame->mCombox->blockSignals(true); @@ -117,11 +122,6 @@ QWidget *Search::pluginUi() if (m_gsettings && m_gsettings->keys().contains(SEARCH_METHOD_KEY)) { m_gsettings->set(SEARCH_METHOD_KEY, checked); } - if (checked) { - m_indexSetFrame->show(); - } else { - m_indexSetFrame->hide(); - } }); connect(m_indexMethodBtnGroup, QOverload::of(&QButtonGroup::buttonToggled),[ = ](int id, bool checked) { if (id == -3) {//fuzzyBtn's id