summaryrefslogtreecommitdiff
path: root/src/webpage.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-07-15 23:50:12 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-07-15 23:50:12 +0200
commit962f44708ea40fe9a00fed17d8b2afba0deb2856 (patch)
tree08f78ebd7ae8a6507b94f5bc716c99fadd1f25be /src/webpage.cpp
parentGoing back to simpler QtWebKit. (diff)
downloadrekonq-962f44708ea40fe9a00fed17d8b2afba0deb2856.tar.xz
Some backports from KdeWebKit and rekonq 0.1 implementation
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r--src/webpage.cpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp
index e8e956ed..d0dd39fb 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -48,9 +48,7 @@
#include <KDE/KFileDialog>
#include <KDE/KInputDialog>
#include <KDE/KMessageBox>
-
-#include <kdewebkit/kwebpage.h>
-#include <kdewebkit/kwebview.h>
+#include <KDE/KJobUiDelegate>
// Qt Includes
#include <QtGui/QContextMenuEvent>
@@ -179,12 +177,12 @@ void WebPage::viewErrorPage(QNetworkReply *reply)
frames.append(frame);
}
}
- if (m_loadingUrl == reply->url())
- {
- mainFrame()->setHtml(html, reply->url());
- // Don't put error pages to the history.
- Application::historyManager()->removeHistoryEntry(reply->url(), mainFrame()->title());
- }
+// if (m_loadingUrl == reply->url())
+// {
+// mainFrame()->setHtml(html, reply->url());
+// // Don't put error pages to the history.
+// Application::historyManager()->removeHistoryEntry(reply->url(), mainFrame()->title());
+// }
}
@@ -257,16 +255,25 @@ void WebPage::slotDownloadRequested(const QNetworkRequest &request)
// }
//
// if (downloadViaKIO) {
-// const QString destUrl = KFileDialog::getSaveFileName(url.fileName(), QString(), view());
-// if (destUrl.isEmpty()) return;
-// KIO::Job *job = KIO::file_copy(url, KUrl(destUrl), -1, KIO::Overwrite);
-// //job->setMetaData(metadata); //TODO: add metadata from request
-// job->addMetaData("MaxCacheSize", "0"); // Don't store in http cache.
-// job->addMetaData("cache", "cache"); // Use entry from cache if available.
-// job->uiDelegate()->setAutoErrorHandlingEnabled(true);
+ const QString destUrl = KFileDialog::getSaveFileName(url.fileName(), QString(), view());
+ if (destUrl.isEmpty()) return;
+ KIO::Job *job = KIO::file_copy(url, KUrl(destUrl), -1, KIO::Overwrite);
+ //job->setMetaData(metadata); //TODO: add metadata from request
+ job->addMetaData("MaxCacheSize", "0"); // Don't store in http cache.
+ job->addMetaData("cache", "cache"); // Use entry from cache if available.
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
// }
+
+
}
+
+QString WebPage::chooseFile(QWebFrame *frame, const QString &suggestedFile)
+{
+ return KFileDialog::getOpenFileName(suggestedFile, QString(), frame->page()->view());
+}
+
+
WebPage *WebPage::newWindow(WebWindowType type)
{
Q_UNUSED(type);