1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Fixed crash on some pages with flash content and click2flash plugin

enabled
This commit is contained in:
nowrep 2011-05-04 18:22:54 +02:00
parent 4924f91f0e
commit 1f9d08ea73
4 changed files with 11 additions and 4 deletions

View File

@ -18,6 +18,7 @@
#ifndef MAINAPPLICATION_H #ifndef MAINAPPLICATION_H
#define MAINAPPLICATION_H #define MAINAPPLICATION_H
#define mApp MainApplication::getInstance() #define mApp MainApplication::getInstance()
#define mStyle MainApplication::appStyle
#include <QToolBar> #include <QToolBar>
#include <QWebSettings> #include <QWebSettings>
@ -43,6 +44,7 @@ class DownloadManager;
class AutoFillModel; class AutoFillModel;
class DesktopNotificationsFactory; class DesktopNotificationsFactory;
class IconProvider; class IconProvider;
class Style;
class MainApplication : public QtSingleApplication class MainApplication : public QtSingleApplication
{ {
@ -88,6 +90,8 @@ public:
DesktopNotificationsFactory* desktopNotifications(); DesktopNotificationsFactory* desktopNotifications();
IconProvider* iconProvider() { return m_iconProvider; } IconProvider* iconProvider() { return m_iconProvider; }
static Style* appStyle;
public slots: public slots:
bool saveStateSlot(); bool saveStateSlot();
void quitApplication(); void quitApplication();

View File

@ -154,7 +154,7 @@ void LocationBar::rssIconClicked()
void LocationBar::showUrl(const QUrl &url, bool empty) void LocationBar::showUrl(const QUrl &url, bool empty)
{ {
if (url.isEmpty() && empty) if (hasFocus() || (url.isEmpty() && empty))
return; return;
if (url.toEncoded()!=text()) { if (url.toEncoded()!=text()) {

View File

@ -61,7 +61,6 @@ ClickToFlash::ClickToFlash(const QUrl &pluginUrl, const QStringList &argumentNam
return; return;
} }
} }
QHBoxLayout* horizontalLayout; QHBoxLayout* horizontalLayout;
QFrame* frame; QFrame* frame;
QHBoxLayout* horizontalLayout_2; QHBoxLayout* horizontalLayout_2;
@ -112,7 +111,7 @@ void ClickToFlash::hideAdBlocked()
findElement(); findElement();
if (!m_element.isNull()) { if (!m_element.isNull()) {
m_element.setAttribute("style", "display:none;"); m_element.setAttribute("style", "display:none;");
deleteLater(); //deleteLater(); //Well, it should be there, but therefore it sometimes crashes
} }
} }

View File

@ -27,11 +27,15 @@ WebPluginFactory::WebPluginFactory(QObject* parent)
QObject* WebPluginFactory::create(const QString &mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const QObject* WebPluginFactory::create(const QString &mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const
{ {
if (mimeType.isEmpty())
return 0;
if (mimeType != "application/x-shockwave-flash") { if (mimeType != "application/x-shockwave-flash") {
if (mimeType != "application/futuresplash") if (mimeType != "application/futuresplash")
qDebug() << mimeType; qDebug() << "missing mimeType handler for: " << mimeType;
return 0; return 0;
} }
if (!mApp->plugins()->c2f_isEnabled()) if (!mApp->plugins()->c2f_isEnabled())
return 0; return 0;