1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

[LocationBar] Don't move the cursor to the end if inline completion is empty.

This commit is contained in:
S. Razi Alavizadeh 2013-08-07 02:02:06 +04:30
parent 20f3b48898
commit 1cca824d66

View File

@ -447,11 +447,12 @@ void LocationBar::keyPressEvent(QKeyEvent* event)
break; break;
case Qt::Key_End: case Qt::Key_End:
case Qt::Key_Right: case Qt::Key_Right: {
if (m_inlineCompletionVisible) { const QString &completionText = m_completer.domainCompletion();
if (m_inlineCompletionVisible && !completionText.isEmpty()) {
m_inlineCompletionVisible = false; m_inlineCompletionVisible = false;
setText(text() + m_completer.domainCompletion()); setText(text() + completionText);
setCursorPosition(text().size()); setCursorPosition(text().size());
m_completer.closePopup(); m_completer.closePopup();
} }
@ -460,6 +461,7 @@ void LocationBar::keyPressEvent(QKeyEvent* event)
m_completer.closePopup(); m_completer.closePopup();
} }
break; break;
}
case Qt::Key_Left: case Qt::Key_Left:
if (m_completer.isPopupVisible()) { if (m_completer.isPopupVisible()) {