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:
Artur Spychaj
2015-12-04 21:42:25 -08:00
parent 2e8ce09703
commit da5186ac80
+6
View File
@@ -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;