summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/webpage.cpp19
-rw-r--r--src/webpage.h2
-rw-r--r--src/webview.cpp6
-rw-r--r--src/webview.h1
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;