summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-06-20 19:33:09 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-06-20 19:33:09 +0200
commit9f9f30aec59b16b94711b3fdd3729b2ea160456d (patch)
treea339d843855a35c044794028785bb3a5e8399bec
parentFinally fixed F5 shortcut (diff)
downloadrekonq-9f9f30aec59b16b94711b3fdd3729b2ea160456d.tar.xz
slot Save File As
-rw-r--r--src/mainwindow.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 2e2cc6cd..4e6ff643 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -57,6 +57,7 @@
#include <KGlobalSettings>
#include <KPushButton>
#include <KTemporaryFile>
+#include <KJobUiDelegate>
#include <kdeprintdialog.h>
#include <kprintpreview.h>
@@ -425,13 +426,14 @@ void MainWindow::slotOpenLocation()
void MainWindow::slotFileSaveAs()
{
- QWebFrame* frame = m_view->currentWebView()->page()->currentFrame();
-
- QString title = frame->title();
- QString content = frame->toPlainText();
-
KUrl srcUrl = currentTab()->url();
- // FIXME implement download file
+
+ const QString destUrl = KFileDialog::getSaveFileName(srcUrl.fileName(), QString(), this);
+ if (destUrl.isEmpty()) return;
+ KIO::Job *job = KIO::file_copy(srcUrl, KUrl(destUrl), -1, KIO::Overwrite);
+ job->addMetaData("MaxCacheSize", "0"); // Don't store in http cache.
+ job->addMetaData("cache", "cache"); // Use entry from cache if available.
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}