From faf815f77e37d45ade13549047c5cafba5b63277 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