diff options
-rw-r--r-- | src/webtab/webpage.cpp | 22 | ||||
-rw-r--r-- | src/webtab/webview.cpp | 10 | ||||
-rw-r--r-- | src/webtab/webview.h | 1 | ||||
-rw-r--r-- | src/webwindow/webwindow.cpp | 1 |
4 files changed, 13 insertions, 21 deletions
diff --git a/src/webtab/webpage.cpp b/src/webtab/webpage.cpp index 8697a9b5..d87c2119 100644 --- a/src/webtab/webpage.cpp +++ b/src/webtab/webpage.cpp @@ -62,6 +62,7 @@ #include <KProtocolInfo> #include <KRun> +#include <KIO/Job> #include <KIO/JobUiDelegate> #include <kparts/browseropenorsavequestion.h> @@ -402,9 +403,9 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) tempFile.open(); KUrl destUrl; destUrl.setPath(tempFile.fileName()); -// KIO::Job *job = KIO::file_copy(_loadingUrl, destUrl, 0600, KIO::Overwrite); -// job->ui()->setWindow(view()); -// connect(job, SIGNAL(result(KJob*)), this, SLOT(copyToTempFileResult(KJob*))); + KIO::Job *job = KIO::file_copy(_loadingUrl, destUrl, 0600, KIO::Overwrite); + job->ui()->setWindow(view()); + connect(job, SIGNAL(result(KJob*)), this, SLOT(copyToTempFileResult(KJob*))); return; } @@ -417,11 +418,8 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) WebView *view = qobject_cast<WebView *>(parent()); WebTab *tab = qobject_cast<WebTab *>(view->parent()); tab->setPart(pa, replyUrl); - -// UrlBar *bar = tab->urlBar(); -// bar->setQUrl(replyUrl); -// -// rApp->mainWindow()->updateHistoryActions(); + + // FIXME: Is this enough? } else { @@ -532,13 +530,7 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) if (isMainFrameRequest) { _isOnRekonqPage = true; - - WebView *view = qobject_cast<WebView *>(parent()); - WebTab *tab = qobject_cast<WebTab *>(view->parent()); -// FIXME UrlBar *bar = tab->urlBar(); -// bar->setQUrl(_loadingUrl); -// -// rApp->mainWindow()->updateHistoryActions(); + // FIXME: is this enough? } } break; diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index 5c83ab84..43f62866 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -70,7 +70,6 @@ WebView::WebView(QWidget* parent) : KWebView(parent, false) - , m_page(0) , m_autoScrollTimer(new QTimer(this)) , m_verticalAutoScrollSpeed(0) , m_horizontalAutoScrollSpeed(0) @@ -132,12 +131,13 @@ void WebView::loadStarted() WebPage *WebView::page() { - if (!m_page) + WebPage *p = qobject_cast<WebPage *>(KWebView::page()); + if (!p) { - m_page = new WebPage(this); - setPage(m_page); + p = new WebPage(this); + setPage(p); } - return m_page; + return p; } diff --git a/src/webtab/webview.h b/src/webtab/webview.h index f4fbfd28..b1648d0d 100644 --- a/src/webtab/webview.h +++ b/src/webtab/webview.h @@ -129,7 +129,6 @@ private: void makeAccessKeyLabel(const QChar &accessKey, const QWebElement &element); private: - WebPage *m_page; QPoint m_clickPos; // Auto Scroll diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp index 48e24852..cdd350b3 100644 --- a/src/webwindow/webwindow.cpp +++ b/src/webwindow/webwindow.cpp @@ -55,6 +55,7 @@ WebWindow::WebWindow(WebPage *page, QWidget *parent) , _edit(new KLineEdit(this)) { _tab->view()->setPage(page); + page->setParent(_tab->view()); init(); } |