Skip to content

Commit

Permalink
ui: Update available docset list if storage changes (fixes #475)
Browse files Browse the repository at this point in the history
  • Loading branch information
trollixx committed Jun 6, 2016
1 parent 26fd6c8 commit aa42fcc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ui/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ SettingsDialog::SettingsDialog(Core::Application *app, QWidget *parent) :
this, &SettingsDialog::updateDocsetFilter);

ui->availableDocsetList->setItemDelegate(new ProgressItemDelegate(this));
connect(m_docsetRegistry, &DocsetRegistry::docsetRemoved, this, [this](const QString name) {
QListWidgetItem *item = findDocsetListItem(m_availableDocsets[name].title());
if (!item)
return;

item->setHidden(false);
});
connect(m_docsetRegistry, &DocsetRegistry::docsetAdded, this, [this](const QString name) {
QListWidgetItem *item = findDocsetListItem(m_availableDocsets[name].title());
if (!item)
return;

item->setHidden(true);
});

// Setup signals & slots
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::saveSettings);
Expand Down

0 comments on commit aa42fcc

Please sign in to comment.