diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-07-24 02:52:32 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-07-24 02:52:32 +0200 |
commit | 087924515fa1a0885b36859123c86ed9a4ff97c3 (patch) | |
tree | 73e95c19098e039064fc767992109e667af9ca30 | |
parent | cleaning code a bit... (diff) | |
download | rekonq-087924515fa1a0885b36859123c86ed9a4ff97c3.tar.xz |
cleaning web* classes and fixing newWindow and createWindow WebPage
slots
-rw-r--r-- | src/webpage.cpp | 19 | ||||
-rw-r--r-- | src/webpage.h | 2 | ||||
-rw-r--r-- | src/webview.cpp | 6 | ||||
-rw-r--r-- | src/webview.h | 1 |
4 files changed, 18 insertions, 10 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index 203de688..80eb6bd8 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -84,7 +84,15 @@ WebPage::WebPage(QObject *parent) } -QWebPage *WebPage::createWindow(QWebPage::WebWindowType type) +WebPage *WebPage::createWindow(QWebPage::WebWindowType type) +{ + kDebug() << "WebPage createWindow slot"; + + return createWindow(type); +} + + +WebPage *WebPage::newWindow(WebWindowType type) { kDebug() << "creating window as new tab.. "; @@ -95,7 +103,7 @@ QWebPage *WebPage::createWindow(QWebPage::WebWindowType type) kDebug() << "Modal Dialog ---------------------------------------"; } - WebView *w = Application::instance()->newWebView(); + WebView *w = Application::instance()->mainWindow()->mainView()->newTab(); return w->page(); } @@ -237,10 +245,3 @@ QString WebPage::chooseFile(QWebFrame *frame, const QString &suggestedFile) { return KFileDialog::getOpenFileName(suggestedFile, QString(), frame->page()->view()); } - - -WebPage *WebPage::newWindow(WebWindowType type) -{ - Q_UNUSED(type); - return 0; -} diff --git a/src/webpage.h b/src/webpage.h index 9c4eef49..cdfb8f00 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -48,7 +48,7 @@ public slots: void manageNetworkErrors(QNetworkReply* reply); protected: - QWebPage *createWindow(QWebPage::WebWindowType type); + WebPage *createWindow(WebWindowType type); virtual WebPage *newWindow(WebWindowType type); QString chooseFile(QWebFrame *frame, const QString &suggestedFile); diff --git a/src/webview.cpp b/src/webview.cpp index 4e308806..f73c38b5 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -73,6 +73,12 @@ WebView::WebView(QWidget* parent) } +WebPage *WebView::page() const +{ + return qobject_cast<WebPage *>(QWebView::page()); +} + + KUrl WebView::url() const { return KUrl(QWebView::url()); diff --git a/src/webview.h b/src/webview.h index 84fc33cb..cbe9c66e 100644 --- a/src/webview.h +++ b/src/webview.h @@ -40,6 +40,7 @@ class WebView : public QWebView public: explicit WebView(QWidget *parent = 0); + WebPage *page() const; KUrl url() const; QString lastStatusBarText() const; int progress() const; |