1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01: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 * 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 * 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 * 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()); urlToLoad = WebView::guessUrlFromString(text() + m_completer.domainCompletion());
} }
@ -194,6 +194,11 @@ QString LocationBar::convertUrlToText(const QUrl &url) const
return stringUrl; return stringUrl;
} }
bool LocationBar::isInlineCompletionVisible() const
{
return m_inlineCompletionVisible && !m_completer.domainCompletion().isEmpty();
}
void LocationBar::urlEnter() void LocationBar::urlEnter()
{ {
const QUrl url = createUrl(); const QUrl url = createUrl();

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -96,6 +96,7 @@ private:
QUrl createUrl(); QUrl createUrl();
QString convertUrlToText(const QUrl &url) const; QString convertUrlToText(const QUrl &url) const;
bool isInlineCompletionVisible() const;
void showGoButton(); void showGoButton();
void hideGoButton(); void hideGoButton();

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * 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 * 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 * 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) SearchEngine SearchEnginesManager::engineForShortcut(const QString &shortcut)
{ {
Engine returnEngine; Engine returnEngine;
if (shortcut.isEmpty()) { if (shortcut.isEmpty()) {
return returnEngine; return returnEngine;
} }