mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
[Fix:] Crash when opening js dialog from locationbar and closing tab
- how to reproduce: 1. write javascript:alert("test"); to locationbar and hit enter 2. alert will show up 3. close tab 4. app will most likely crash
This commit is contained in:
parent
c78d9f4978
commit
4439a1d57f
|
@ -123,7 +123,7 @@ void LocationBar::urlEnter()
|
|||
}
|
||||
|
||||
m_webView->setFocus();
|
||||
m_webView->load(urlToLoad);
|
||||
emit loadUrl(urlToLoad);
|
||||
}
|
||||
|
||||
void LocationBar::textEdit()
|
||||
|
@ -247,8 +247,10 @@ void LocationBar::dropEvent(QDropEvent* event)
|
|||
QUrl dropUrl = event->mimeData()->urls().at(0);
|
||||
if (WebView::isUrlValid(dropUrl)) {
|
||||
setText(dropUrl.toString());
|
||||
p_QupZilla->loadAddress(dropUrl);
|
||||
QLineEdit::focusOutEvent(new QFocusEvent(QFocusEvent::FocusOut));
|
||||
|
||||
m_webView->setFocus();
|
||||
emit loadUrl(dropUrl);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -256,8 +258,10 @@ void LocationBar::dropEvent(QDropEvent* event)
|
|||
QUrl dropUrl = QUrl(event->mimeData()->text().trimmed());
|
||||
if (WebView::isUrlValid(dropUrl)) {
|
||||
setText(dropUrl.toString());
|
||||
p_QupZilla->loadAddress(dropUrl);
|
||||
QLineEdit::focusOutEvent(new QFocusEvent(QFocusEvent::FocusOut));
|
||||
|
||||
m_webView->setFocus();
|
||||
emit loadUrl(dropUrl);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,9 @@ public:
|
|||
|
||||
void setWebView(WebView* view) { m_webView = view; }
|
||||
|
||||
signals:
|
||||
void loadUrl(const QUrl &url);
|
||||
|
||||
public slots:
|
||||
void showUrl(const QUrl &url, bool empty = true);
|
||||
|
||||
|
|
|
@ -316,6 +316,7 @@ void TabBar::mouseDoubleClickEvent(QMouseEvent* event)
|
|||
m_tabWidget->addView(QUrl(), tr("New tab"), TabWidget::NewTab, true);
|
||||
return;
|
||||
}
|
||||
|
||||
QTabBar::mouseDoubleClickEvent(event);
|
||||
}
|
||||
|
||||
|
@ -335,5 +336,6 @@ void TabBar::mouseReleaseEvent(QMouseEvent* event)
|
|||
m_tabWidget->addView(QUrl(), tr("New tab"), TabWidget::NewSelectedTab, true);
|
||||
return;
|
||||
}
|
||||
|
||||
QTabBar::mouseReleaseEvent(event);
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar)
|
|||
connect(m_view.data(), SIGNAL(showUrl(QUrl)), m_locationBar.data(), SLOT(showUrl(QUrl)));
|
||||
connect(m_view.data(), SIGNAL(rssChanged(bool)), m_locationBar.data(), SLOT(showRSSIcon(bool)));
|
||||
connect(m_view.data()->webPage(), SIGNAL(privacyChanged(bool)), m_locationBar.data(), SLOT(setPrivacy(bool)));
|
||||
connect(m_locationBar.data(), SIGNAL(loadUrl(QUrl)), m_view.data(), SLOT(load(QUrl)));
|
||||
}
|
||||
|
||||
void WebTab::showNotification(QWidget* notif)
|
||||
|
|
|
@ -47,7 +47,6 @@ public:
|
|||
int getLoading() { return m_progress; }
|
||||
|
||||
void zoomReset();
|
||||
void load(const QUrl &url);
|
||||
QUrl url() const;
|
||||
QString title() const;
|
||||
void reload();
|
||||
|
@ -80,6 +79,8 @@ signals:
|
|||
void rssChanged(bool state);
|
||||
|
||||
public slots:
|
||||
void load(const QUrl &url);
|
||||
|
||||
void stop();
|
||||
void back();
|
||||
void forward();
|
||||
|
|
Loading…
Reference in New Issue
Block a user