1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

LocationBar: Don't allow to load url when tab is not restored

This can currently happen only when unloading tab
This commit is contained in:
David Rosca 2018-01-28 21:48:23 +01:00
parent 2d01a6d092
commit 13e81d0b21
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -388,6 +388,10 @@ void LocationBar::showUrl(const QUrl &url)
void LocationBar::loadRequest(const LoadRequest &request) void LocationBar::loadRequest(const LoadRequest &request)
{ {
if (!m_webView->webTab()->isRestored()) {
return;
}
const QString urlString = convertUrlToText(request.url()); const QString urlString = convertUrlToText(request.url());
m_completer->closePopup(); m_completer->closePopup();
@ -499,9 +503,7 @@ void LocationBar::dropEvent(QDropEvent* event)
const QUrl dropUrl = event->mimeData()->urls().at(0); const QUrl dropUrl = event->mimeData()->urls().at(0);
if (WebView::isUrlValid(dropUrl)) { if (WebView::isUrlValid(dropUrl)) {
setText(dropUrl.toString()); setText(dropUrl.toString());
loadRequest(dropUrl);
m_webView->setFocus();
m_webView->userLoadAction(dropUrl);
QFocusEvent event(QFocusEvent::FocusOut); QFocusEvent event(QFocusEvent::FocusOut);
LineEdit::focusOutEvent(&event); LineEdit::focusOutEvent(&event);
@ -513,9 +515,7 @@ void LocationBar::dropEvent(QDropEvent* event)
const QUrl dropUrl = QUrl(dropText); const QUrl dropUrl = QUrl(dropText);
if (WebView::isUrlValid(dropUrl)) { if (WebView::isUrlValid(dropUrl)) {
setText(dropUrl.toString()); setText(dropUrl.toString());
loadRequest(dropUrl);
m_webView->setFocus();
m_webView->userLoadAction(dropUrl);
QFocusEvent event(QFocusEvent::FocusOut); QFocusEvent event(QFocusEvent::FocusOut);
LineEdit::focusOutEvent(&event); LineEdit::focusOutEvent(&event);