mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Hopefully fixed occasional crash when closing tab
This commit is contained in:
parent
8c927529c0
commit
61269f8c0a
|
@ -166,9 +166,6 @@ void BookmarksManager::contextMenuRequested(const QPoint &position)
|
|||
moveMenu.addAction(style()->standardIcon(QStyle::SP_DirIcon), query.value(0).toString(), this, SLOT(moveBookmark()))->setData(query.value(0).toString());
|
||||
menu.addMenu(&moveMenu);
|
||||
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("&Close"), this, SLOT(close()));
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint pos = QCursor::pos();
|
||||
QPoint p(pos.x(), pos.y()+1);
|
||||
|
|
|
@ -92,9 +92,6 @@ void HistoryManager::contextMenuRequested(const QPoint &position)
|
|||
menu.addAction(tr("Open link in new tab"), this, SLOT(loadInNewTab()))->setData(link);
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Close"), this, SLOT(close()));
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint pos = QCursor::pos();
|
||||
QPoint p(pos.x(), pos.y()+1);
|
||||
|
|
|
@ -199,8 +199,6 @@ void RSSManager::customContextMenuRequested(const QPoint &position)
|
|||
QMenu menu;
|
||||
menu.addAction(tr("Open link in actual tab"), getQupZilla(), SLOT(loadActionUrl()))->setData(link);
|
||||
menu.addAction(tr("Open link in new tab"), this, SLOT(loadFeedInNewTab()))->setData(link);
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Close"), this, SLOT(close()));
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint pos = QCursor::pos();
|
||||
|
|
|
@ -170,6 +170,12 @@ void WebPage::addAdBlockRule(const QString &filter, const QUrl &url)
|
|||
entry.url = url;
|
||||
|
||||
m_adBlockedEntries.append(entry);
|
||||
|
||||
QWebElement docElement = mainFrame()->documentElement();
|
||||
QWebElementCollection elements;
|
||||
elements.append(docElement.findAll("*[src=\"" + url.toString() + "\"]"));
|
||||
foreach (QWebElement element, elements)
|
||||
element.removeFromDocument();
|
||||
}
|
||||
|
||||
bool WebPage::extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output)
|
||||
|
@ -287,19 +293,6 @@ bool WebPage::extension(Extension extension, const ExtensionOption* option, Exte
|
|||
return true;
|
||||
}
|
||||
|
||||
void WebPage::adBlockCleanup()
|
||||
{
|
||||
QWebElement docElement = mainFrame()->documentElement();
|
||||
|
||||
foreach (AdBlockedEntry entry, m_adBlockedEntries) {
|
||||
QWebElementCollection elements;
|
||||
elements.append(docElement.findAll("*[src=\"" + entry.url.toString() + "\"]"));
|
||||
foreach (QWebElement element, elements)
|
||||
// element.setAttribute("style", "display:none;");
|
||||
element.removeFromDocument();
|
||||
}
|
||||
}
|
||||
|
||||
bool WebPage::javaScriptPrompt(QWebFrame* originatingFrame, const QString &msg, const QString &defaultValue, QString* result)
|
||||
{
|
||||
WebView* _view = (WebView*)originatingFrame->page()->view();
|
||||
|
|
|
@ -56,7 +56,6 @@ public:
|
|||
|
||||
void addAdBlockRule(const QString &filter, const QUrl &url);
|
||||
QList<AdBlockedEntry> adBlockedEntries() { return m_adBlockedEntries; }
|
||||
void adBlockCleanup();
|
||||
|
||||
signals:
|
||||
void privacyChanged(bool status);
|
||||
|
|
|
@ -239,7 +239,6 @@ void WebView::loadFinished(bool state)
|
|||
titleChanged();
|
||||
mApp->autoFill()->completePage(this);
|
||||
QHostInfo::lookupHost(url().host(), this, SLOT(setIp(QHostInfo)));
|
||||
m_page->adBlockCleanup();
|
||||
|
||||
if (isCurrent()) {
|
||||
p_QupZilla->progressBar()->setVisible(false);
|
||||
|
|
Loading…
Reference in New Issue
Block a user