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

LocationCompleter: Fix possibility to be opened at wrong position/time

This commit is contained in:
David Rosca 2017-10-31 18:46:58 +01:00
parent dcf1cfd96e
commit 033f701784

View File

@ -95,6 +95,7 @@ void LocationCompleter::complete(const QString &string)
void LocationCompleter::showMostVisited() void LocationCompleter::showMostVisited()
{ {
m_locationBar->setFocus();
complete(QString()); complete(QString());
} }
@ -166,8 +167,9 @@ void LocationCompleter::addSuggestions(const QStringList &suggestions)
} }
s_model->addCompletions(items); s_model->addCompletions(items);
adjustPopupSize();
m_oldSuggestions = suggestions; m_oldSuggestions = suggestions;
showPopup();
} }
void LocationCompleter::currentChanged(const QModelIndex &index) void LocationCompleter::currentChanged(const QModelIndex &index)
@ -295,7 +297,7 @@ void LocationCompleter::indexDeleteRequested(const QModelIndex &index)
closePopup(); closePopup();
} }
else { else {
adjustPopupSize(); showPopup();
} }
} }
@ -337,7 +339,7 @@ void LocationCompleter::showPopup()
{ {
Q_ASSERT(m_locationBar); Q_ASSERT(m_locationBar);
if (s_model->rowCount() == 0) { if (!m_locationBar->hasFocus() || s_model->rowCount() == 0) {
s_view->close(); s_view->close();
return; return;
} }