Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Commit

Permalink
LocationCompleter: Fix possibility to be opened at wrong position/time
Browse files Browse the repository at this point in the history
  • Loading branch information
nowrep committed Oct 31, 2017
1 parent 45b0199 commit 4a08df8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/navigation/completer/locationcompleter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void LocationCompleter::complete(const QString &string)

void LocationCompleter::showMostVisited()
{
m_locationBar->setFocus();
complete(QString());
}

Expand Down Expand Up @@ -166,8 +167,9 @@ void LocationCompleter::addSuggestions(const QStringList &suggestions)
}

s_model->addCompletions(items);
adjustPopupSize();
m_oldSuggestions = suggestions;

showPopup();
}

void LocationCompleter::currentChanged(const QModelIndex &index)
Expand Down Expand Up @@ -295,7 +297,7 @@ void LocationCompleter::indexDeleteRequested(const QModelIndex &index)
closePopup();
}
else {
adjustPopupSize();
showPopup();
}
}

Expand Down Expand Up @@ -337,7 +339,7 @@ void LocationCompleter::showPopup()
{
Q_ASSERT(m_locationBar);

if (s_model->rowCount() == 0) {
if (!m_locationBar->hasFocus() || s_model->rowCount() == 0) {
s_view->close();
return;
}
Expand Down

0 comments on commit 4a08df8

Please sign in to comment.