diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-11-29 11:33:13 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:06 +0100 |
commit | 95c3dbf890d813ab3867ef798054d2741cfc6ad4 (patch) | |
tree | 2770923b7ee665ce0f15db10bbfe47302452805e /src | |
parent | Restoring inspector, part 3 (diff) | |
download | rekonq-95c3dbf890d813ab3867ef798054d2741cfc6ad4.tar.xz |
Use view parent tab to get use calling tab exists
Diffstat (limited to 'src')
-rw-r--r-- | src/webtab/webpage.cpp | 4 | ||||
-rw-r--r-- | src/webtab/webview.cpp | 6 | ||||
-rw-r--r-- | src/webtab/webview.h | 2 |
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, |