diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-03-13 00:23:00 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-03-13 11:00:27 +0100 |
commit | 707c0b1761e2823e4253bcb441a1a54478e5b76d (patch) | |
tree | f6fb2b89ca049c11edd4dd3bb1c9acc42564676c /src/webtab.cpp | |
parent | Fix toolbars rekonfig... (diff) | |
download | rekonq-707c0b1761e2823e4253bcb441a1a54478e5b76d.tar.xz |
Get sure urlbar(s) are deleted when related webtab is
Heinz, Paul. Please test actual master before backporting this to
0.9 series. Many thanks for your help and for this bug report.
I'm crossing fingers to hear good news from your tests ;)
CCBUG:295301
Diffstat (limited to 'src/webtab.cpp')
-rw-r--r-- | src/webtab.cpp | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp index e5cfac56..57f46ea4 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -60,7 +60,7 @@ WebTab::WebTab(QWidget *parent) : QWidget(parent) - , m_webView(new WebView(this)) + , m_webView(0) , m_urlBar(new UrlBar(this)) , m_progress(0) , m_part(0) @@ -71,13 +71,13 @@ WebTab::WebTab(QWidget *parent) l->setMargin(0); l->setSpacing(0); - l->addWidget(m_webView); - m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + l->addWidget(view()); + view()->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); // fix focus handling - setFocusProxy(m_webView); + setFocusProxy(view()); - KWebWallet *wallet = m_webView->page()->wallet(); + KWebWallet *wallet = page()->wallet(); if (wallet) { @@ -85,12 +85,12 @@ WebTab::WebTab(QWidget *parent) this, SLOT(createWalletBar(QString,QUrl))); } - connect(m_webView, SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int))); - connect(m_webView, SIGNAL(loadStarted()), this, SLOT(resetProgress())); - connect(m_webView, SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString))); + connect(view(), SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int))); + connect(view(), SIGNAL(loadStarted()), this, SLOT(resetProgress())); + connect(view(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString))); // Session Manager - connect(m_webView, SIGNAL(loadFinished(bool)), rApp->sessionManager(), SLOT(saveSession())); + connect(view(), SIGNAL(loadFinished(bool)), rApp->sessionManager(), SLOT(saveSession())); } @@ -100,6 +100,24 @@ WebTab::~WebTab() m_previewSelectorBar.clear(); delete m_part; + delete m_urlBar; + delete m_webView; +} + + +WebView *WebTab::view() +{ + if (!m_webView) + { + m_webView = new WebView(this); + } + return m_webView; +} + + +WebPage *WebTab::page() +{ + return view()->page(); } |