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