diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-03-13 00:23:00 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-03-13 00:23:00 +0100 |
commit | f6cc2c5c13fbc219a6bc3391994b6cdeca44dd10 (patch) | |
tree | 9b4c20c4ec3e9c5f50b780267bd63fe8751bb8cf /src/webview.cpp | |
parent | Let rekonq load urls on new tabs on sites checking the referer ;) (diff) | |
download | rekonq-f6cc2c5c13fbc219a6bc3391994b6cdeca44dd10.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/webview.cpp')
-rw-r--r-- | src/webview.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index ee1ec270..80f021fc 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -65,6 +65,7 @@ WebView::WebView(QWidget* parent) : KWebView(parent, false) + , m_page(0) , m_autoScrollTimer(new QTimer(this)) , m_verticalAutoScrollSpeed(0) , m_horizontalAutoScrollSpeed(0) @@ -77,11 +78,8 @@ WebView::WebView(QWidget* parent) , m_accessKeysPressed(false) , m_accessKeysActive(false) { - WebPage *page = new WebPage(this); - setPage(page); - // download system - connect(this, SIGNAL(linkShiftClicked(KUrl)), page, SLOT(downloadUrl(KUrl))); + connect(this, SIGNAL(linkShiftClicked(KUrl)), page(), SLOT(downloadUrl(KUrl))); // middle click || ctrl + click signal connect(this, SIGNAL(linkMiddleOrCtrlClicked(KUrl)), this, SLOT(loadUrlInNewTab(KUrl))); @@ -132,9 +130,12 @@ void WebView::changeWindowIcon() WebPage *WebView::page() { - WebPage *const page = qobject_cast<WebPage *>(KWebView::page()); - Q_ASSERT(page); - return page; + if (!m_page) + { + m_page = new WebPage(this); + setPage(m_page); + } + return m_page; } |