From ff6acd7ee07b4cf41392a522b96d044dca5b6d10 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 24 Jul 2009 15:28:15 +0200 Subject: Pano "create new windowd" bug fix and other little web classes improvements --- src/webpage.cpp | 4 +--- src/webview.cpp | 9 +++++++-- src/webview.h | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/webpage.cpp b/src/webpage.cpp index 80eb6bd8..bb6f0d9c 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -88,14 +88,12 @@ WebPage *WebPage::createWindow(QWebPage::WebWindowType type) { kDebug() << "WebPage createWindow slot"; - return createWindow(type); + return newWindow(type); } WebPage *WebPage::newWindow(WebWindowType type) { - kDebug() << "creating window as new tab.. "; - // added to manage web modal dialogs if (type == QWebPage::WebModalDialog) { diff --git a/src/webview.cpp b/src/webview.cpp index f73c38b5..101b6e06 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -73,9 +73,14 @@ WebView::WebView(QWidget* parent) } -WebPage *WebView::page() const +WebPage *WebView::page() { - return qobject_cast(QWebView::page()); + if(!m_page) + { + m_page = new WebPage(); + setPage(m_page); + } + return m_page; } diff --git a/src/webview.h b/src/webview.h index cbe9c66e..4efb2733 100644 --- a/src/webview.h +++ b/src/webview.h @@ -40,7 +40,7 @@ class WebView : public QWebView public: explicit WebView(QWidget *parent = 0); - WebPage *page() const; + WebPage *page(); KUrl url() const; QString lastStatusBarText() const; int progress() const; -- cgit v1.2.1