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

LocationCompleter: Fix popup opening with suggestions after it was closed

This commit is contained in:
David Rosca 2018-01-26 12:46:18 +01:00
parent b9294e02bb
commit 5ee0623d32
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -68,7 +68,6 @@ bool LocationCompleter::isVisible() const
void LocationCompleter::closePopup()
{
m_popupClosed = true;
s_view->close();
}
@ -140,6 +139,7 @@ void LocationCompleter::refreshJobFinished()
void LocationCompleter::slotPopupClosed()
{
m_popupClosed = true;
m_oldSuggestions.clear();
disconnect(s_view, SIGNAL(closed()), this, SLOT(slotPopupClosed()));
@ -179,7 +179,9 @@ void LocationCompleter::addSuggestions(const QStringList &suggestions)
s_model->addCompletions(items);
m_oldSuggestions = suggestions;
showPopup();
if (!m_popupClosed) {
showPopup();
}
}
void LocationCompleter::currentChanged(const QModelIndex &index)
@ -275,13 +277,7 @@ void LocationCompleter::indexDeleteRequested(const QModelIndex &index)
s_model->removeRow(index.row(), index.parent());
s_view->setUpdatesEnabled(true);
// Close popup when removing last item
if (s_model->rowCount() == 0) {
closePopup();
}
else {
showPopup();
}
showPopup();
}
LoadRequest LocationCompleter::createLoadRequest(const QModelIndex &index)