mirror of
https://github.com/zealdocs/zeal.git
synced 2026-08-29 16:40:51 +08:00
ui: Update completions on docset add (fixes #478)
Update completions in search box whenever a docset is installed or removed.
This commit is contained in:
@@ -230,6 +230,7 @@ MainWindow::MainWindow(Core::Application *app, QWidget *parent) :
|
||||
|
||||
connect(m_application->docsetRegistry(), &DocsetRegistry::docsetRemoved,
|
||||
this, [this](const QString &name) {
|
||||
setupSearchBoxCompletions();
|
||||
for (SearchState *searchState : m_tabs) {
|
||||
#ifdef USE_WEBENGINE
|
||||
if (docsetName(searchState->page->url()) != name)
|
||||
@@ -246,6 +247,11 @@ MainWindow::MainWindow(Core::Application *app, QWidget *parent) :
|
||||
}
|
||||
});
|
||||
|
||||
connect(m_application->docsetRegistry(), &DocsetRegistry::docsetAdded,
|
||||
this, [this](const QString &) {
|
||||
setupSearchBoxCompletions();
|
||||
});
|
||||
|
||||
connect(ui->lineEdit, &QLineEdit::textChanged, [this](const QString &text) {
|
||||
if (!m_searchState || text == m_searchState->searchQuery)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user