1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

NavigationBar: Correctly filter invalid layout ids

This commit is contained in:
David Rosca 2018-01-08 19:57:09 +01:00
parent 1f9599aac7
commit 23f84abc3b
2 changed files with 7 additions and 1 deletions

View File

@ -510,6 +510,7 @@ void NavigationBar::loadSettings()
settings.endGroup(); settings.endGroup();
m_layoutIds.removeDuplicates(); m_layoutIds.removeDuplicates();
m_layoutIds.removeAll(QString());
if (!m_layoutIds.contains(QSL("locationbar"))) { if (!m_layoutIds.contains(QSL("locationbar"))) {
m_layoutIds.append(QSL("locationbar")); m_layoutIds.append(QSL("locationbar"));
} }

View File

@ -55,7 +55,12 @@ void NavigationBarConfigDialog::loadSettings()
ui->currentItems->clear(); ui->currentItems->clear();
for (const QString &id : qAsConst(m_navigationBar->m_layoutIds)) { for (const QString &id : qAsConst(m_navigationBar->m_layoutIds)) {
ui->currentItems->addItem(createItem(m_navigationBar->m_widgets.value(id))); NavigationBar::WidgetData data = m_navigationBar->m_widgets.value(id);
if (data.id.isEmpty()) {
data.id = id;
data.name = id;
}
ui->currentItems->addItem(createItem(data));
} }
ui->availableItems->clear(); ui->availableItems->clear();