Fix the problem that the fuzzy search button is not displayed when the index switch is turned on by ask dialog.

This commit is contained in:
JunjieBai 2023-01-31 09:28:56 +08:00 committed by iaom
parent f82f1cb4cd
commit faf815f77e
1 changed files with 7 additions and 7 deletions

View File

@ -95,10 +95,15 @@ QWidget *Search::pluginUi()
//监听gsettings值改变更新控制面板UI //监听gsettings值改变更新控制面板UI
connect(m_gsettings, &QGSettings::changed, this, [ = ](const QString &key) { connect(m_gsettings, &QGSettings::changed, this, [ = ](const QString &key) {
if (key == SEARCH_METHOD_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->blockSignals(true);
m_searchMethodBtn->setChecked(is_index_search_on); m_searchMethodBtn->setChecked(isIndexSearchOn);
m_searchMethodBtn->blockSignals(false); m_searchMethodBtn->blockSignals(false);
if (isIndexSearchOn) {
m_indexSetFrame->show();
} else {
m_indexSetFrame->hide();
}
} else if (key == WEB_ENGINE_KEY) { } else if (key == WEB_ENGINE_KEY) {
QString engine = m_gsettings->get(WEB_ENGINE_KEY).toString(); QString engine = m_gsettings->get(WEB_ENGINE_KEY).toString();
m_webEngineFrame->mCombox->blockSignals(true); m_webEngineFrame->mCombox->blockSignals(true);
@ -117,11 +122,6 @@ QWidget *Search::pluginUi()
if (m_gsettings && m_gsettings->keys().contains(SEARCH_METHOD_KEY)) { if (m_gsettings && m_gsettings->keys().contains(SEARCH_METHOD_KEY)) {
m_gsettings->set(SEARCH_METHOD_KEY, checked); m_gsettings->set(SEARCH_METHOD_KEY, checked);
} }
if (checked) {
m_indexSetFrame->show();
} else {
m_indexSetFrame->hide();
}
}); });
connect(m_indexMethodBtnGroup, QOverload<int, bool>::of(&QButtonGroup::buttonToggled),[ = ](int id, bool checked) { connect(m_indexMethodBtnGroup, QOverload<int, bool>::of(&QButtonGroup::buttonToggled),[ = ](int id, bool checked) {
if (id == -3) {//fuzzyBtn's id if (id == -3) {//fuzzyBtn's id