From 9f9f30aec59b16b94711b3fdd3729b2ea160456d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 19:33:09 +0200 Subject: slot Save File As --- src/mainwindow.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/mainwindow.cpp') 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 #include #include +#include #include #include @@ -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); } -- cgit v1.2.1