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

Fixed issue with completer when writing "ch" into location bar.

- ?? for some reason, it selected random items when typing "ch" ??
This commit is contained in:
nowrep 2012-04-24 15:58:36 +02:00
parent c9517460a2
commit 23613ab310
2 changed files with 7 additions and 6 deletions

View File

@ -45,6 +45,7 @@ QPersistentModelIndex LocationCompleterView::hoveredIndex() const
bool LocationCompleterView::eventFilter(QObject* object, QEvent* event) bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
{ {
Q_UNUSED(object)
// Event filter based on QCompleter::eventFilter from qcompleter.cpp // Event filter based on QCompleter::eventFilter from qcompleter.cpp
switch (event->type()) { switch (event->type()) {
@ -121,12 +122,12 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
} // switch (keyEvent->key()) } // switch (keyEvent->key())
(static_cast<QObject*>(focusProxy()))->event(keyEvent); (static_cast<QObject*>(focusProxy()))->event(keyEvent);
break; return true;
} }
case QEvent::Show: case QEvent::Show:
m_ignoreNextMouseMove = true; m_ignoreNextMouseMove = true;
return false; break;
case QEvent::MouseButtonPress: case QEvent::MouseButtonPress:
if (!underMouse()) { if (!underMouse()) {
@ -135,16 +136,16 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
} }
break; break;
case QEvent::InputMethod:
case QEvent::ShortcutOverride: case QEvent::ShortcutOverride:
case QEvent::InputMethod:
QApplication::sendEvent(focusProxy(), event); QApplication::sendEvent(focusProxy(), event);
break; break;
default: default:
return QListView::eventFilter(object, event); break;
} // switch (event->type()) } // switch (event->type())
return QListView::eventFilter(object, event); return false;
} }
void LocationCompleterView::close() void LocationCompleterView::close()

View File

@ -490,7 +490,7 @@ QString WebPage::userAgentForUrl(const QUrl &url) const
// Let Google services (and Facebook) play nice with us // Let Google services (and Facebook) play nice with us
if (host.contains("google") || host.contains("facebook")) { if (host.contains("google") || host.contains("facebook")) {
if (s_fakeUserAgent.isEmpty()) { if (s_fakeUserAgent.isEmpty()) {
s_fakeUserAgent = "Mozilla/5.0 (" + qz_buildSystem() + ") AppleWebKit/" + QupZilla::WEBKITVERSION + " (KHTML, like Gecko) Chrome/10.0 Safari/" + QupZilla::WEBKITVERSION; s_fakeUserAgent = QString("Mozilla/5.0 (%1) AppleWebKit/%2 (KHTML, like Gecko) Chrome/10.0 Safari/%2").arg(qz_buildSystem(), QupZilla::WEBKITVERSION);
} }
return s_fakeUserAgent; return s_fakeUserAgent;