1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56: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") {
cout << "QupZilla v" << QupZilla::VERSION.toUtf8().data()
#ifdef GIT_REVISION
#ifdef GIT_REVISION
<< " rev " << GIT_REVISION << " "
#endif
#endif
<< "(build " << QupZilla::BUILDTIME.toUtf8().data() << ")"
<< endl;
found = true;

View File

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

View File

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