1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

[SearchShortcuts] Fixed using search shortcuts longer than one character

This commit is contained in:
nowrep 2014-01-08 10:39:41 +01:00
parent 0758ba39ab
commit d61b72bd87
3 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -166,7 +166,7 @@ QUrl LocationBar::createUrl()
}
}
if (m_inlineCompletionVisible) {
if (isInlineCompletionVisible()) {
urlToLoad = WebView::guessUrlFromString(text() + m_completer.domainCompletion());
}
@ -194,6 +194,11 @@ QString LocationBar::convertUrlToText(const QUrl &url) const
return stringUrl;
}
bool LocationBar::isInlineCompletionVisible() const
{
return m_inlineCompletionVisible && !m_completer.domainCompletion().isEmpty();
}
void LocationBar::urlEnter()
{
const QUrl url = createUrl();

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -96,6 +96,7 @@ private:
QUrl createUrl();
QString convertUrlToText(const QUrl &url) const;
bool isInlineCompletionVisible() const;
void showGoButton();
void hideGoButton();

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -97,6 +97,7 @@ void SearchEnginesManager::loadSettings()
SearchEngine SearchEnginesManager::engineForShortcut(const QString &shortcut)
{
Engine returnEngine;
if (shortcut.isEmpty()) {
return returnEngine;
}