summaryrefslogtreecommitdiff
path: root/src/webtab
diff options
context:
space:
mode:
Diffstat (limited to 'src/webtab')
-rw-r--r--src/webtab/webpage.cpp4
-rw-r--r--src/webtab/webview.cpp6
-rw-r--r--src/webtab/webview.h2
3 files changed, 10 insertions, 2 deletions
diff --git a/src/webtab/webpage.cpp b/src/webtab/webpage.cpp
index 7f681ee3..866733d0 100644
--- a/src/webtab/webpage.cpp
+++ b/src/webtab/webpage.cpp
@@ -214,7 +214,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r
if (_isOnRekonqPage)
{
WebView *view = qobject_cast<WebView *>(parent());
- WebTab *tab = qobject_cast<WebTab *>(view->parent());
+ WebTab *tab = view->parentTab();
_isOnRekonqPage = false;
tab->setPart(0, KUrl()); // re-enable the view page
}
@@ -455,7 +455,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply)
_isOnRekonqPage = true;
WebView *view = qobject_cast<WebView *>(parent());
- WebTab *tab = qobject_cast<WebTab *>(view->parent());
+ WebTab *tab = view->parentTab();
tab->setPart(pa, replyUrl);
// WARNING: Is this enough?
diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp
index 2a73b050..db87a993 100644
--- a/src/webtab/webview.cpp
+++ b/src/webtab/webview.cpp
@@ -1472,3 +1472,9 @@ void WebView::slotSpellCheckDone(const QString&)
execJScript(m_contextMenuHitResult, script);
}
}
+
+
+WebTab *WebView::parentTab()
+{
+ return m_parentTab;
+}
diff --git a/src/webtab/webview.h b/src/webtab/webview.h
index 4510bec3..b33f3d87 100644
--- a/src/webtab/webview.h
+++ b/src/webtab/webview.h
@@ -68,6 +68,8 @@ public:
WebPage *page();
void setPage(WebPage *);
+
+ WebTab *parentTab();
void load(const QUrl &url);
void load(const QNetworkRequest &req,