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

Hopefully fixed occasional crash when closing tab

This commit is contained in:
nowrep 2011-08-04 21:37:04 +02:00
parent 8c927529c0
commit 61269f8c0a
6 changed files with 6 additions and 23 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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);

View File

@ -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);