1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-21 03:06:34 +01:00

[Fix] Fixed crash in QWebInspector when using QtWebKit 2.2

- somehow it is no longer safe to delete QWebInspector ...
This commit is contained in:
nowrep 2011-12-18 16:57:14 +01:00
parent 5f7d64537a
commit d1c80b826c
4 changed files with 46 additions and 9 deletions

View File

@ -80,9 +80,9 @@ void CommandLineOptions::parseActions()
} }
if (arg == "-v" || arg == "--version") { if (arg == "-v" || arg == "--version") {
cout << "QupZilla v" << QupZilla::VERSION.toUtf8().data() cout << "QupZilla v" << QupZilla::VERSION.toUtf8().data()
#ifdef GIT_REVISION #ifdef GIT_REVISION
<< " rev " << GIT_REVISION << " " << " rev " << GIT_REVISION << " "
#endif #endif
<< "(build " << QupZilla::BUILDTIME.toUtf8().data() << ")" << "(build " << QupZilla::BUILDTIME.toUtf8().data() << ")"
<< endl; << endl;
found = true; found = true;

View File

@ -36,7 +36,9 @@ WebInspectorDockWidget::WebInspectorDockWidget(QupZilla* mainClass)
void WebInspectorDockWidget::close() void WebInspectorDockWidget::close()
{ {
#if (QTWEBKIT_VERSION < QTWEBKIT_VERSION_CHECK(2, 2, 0))
delete m_inspector.data(); delete m_inspector.data();
#endif
p_QupZilla->weView()->webTab()->setInspectorVisible(false); p_QupZilla->weView()->webTab()->setInspectorVisible(false);
hide(); hide();

View File

@ -50,6 +50,41 @@ WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar)
connect(m_locationBar.data(), SIGNAL(loadUrl(QUrl)), m_view.data(), SLOT(load(QUrl))); connect(m_locationBar.data(), SIGNAL(loadUrl(QUrl)), m_view.data(), SLOT(load(QUrl)));
} }
WebView* WebTab::view()
{
return m_view.data();
}
bool WebTab::isPinned()
{
return m_pinned;
}
void WebTab::setPinned(bool state)
{
m_pinned = state;
}
void WebTab::setLocationBar(LocationBar* bar)
{
m_locationBar = bar;
}
LocationBar* WebTab::locationBar()
{
return m_locationBar.data();
}
bool WebTab::inspectorVisible()
{
return m_inspectorVisible;
}
void WebTab::setInspectorVisible(bool v)
{
m_inspectorVisible = v;
}
void WebTab::showNotification(QWidget* notif) void WebTab::showNotification(QWidget* notif)
{ {
if (m_layout->count() > 1) { if (m_layout->count() > 1) {

View File

@ -32,16 +32,16 @@ class WebTab : public QWidget
public: public:
explicit WebTab(QupZilla* mainClass, LocationBar* locationBar); explicit WebTab(QupZilla* mainClass, LocationBar* locationBar);
~WebTab(); ~WebTab();
WebView* view() { return m_view.data(); } WebView* view();
bool isPinned() { return m_pinned; } bool isPinned();
void pinTab(int index); void pinTab(int index);
void setPinned(bool state) { m_pinned = state; } void setPinned(bool state);
void setLocationBar(LocationBar* bar) { m_locationBar = bar; } void setLocationBar(LocationBar* bar);
LocationBar* locationBar() { return m_locationBar.data(); } LocationBar* locationBar();
bool inspectorVisible() { return m_inspectorVisible; } bool inspectorVisible();
void setInspectorVisible(bool v) { m_inspectorVisible = v; } void setInspectorVisible(bool v);
private slots: private slots:
void showNotification(QWidget* notif); void showNotification(QWidget* notif);