From 436ff1dd4bfc42605f8c4e13b3a4bfecf33e1c31 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 26 May 2010 12:10:17 +0200 Subject: Save right files when being on "rekonq pages" eg: KParts --- src/mainwindow.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 43418ed3..95fbd92d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -609,8 +609,19 @@ void MainWindow::openLocation() void MainWindow::fileSaveAs() { - KUrl srcUrl = currentTab()->url(); - + KUrl srcUrl; + WebTab *w = currentTab(); + if (w->page()->isOnRekonqPage()) + { + QWebElement el = w->page()->mainFrame()->documentElement(); + srcUrl = KUrl( el.findFirst("object").attribute("data") ); + } + else + { + srcUrl = w->url(); + } + kDebug() << "URL to save: " << srcUrl; + QString name = srcUrl.fileName(); if (name.isNull()) { -- cgit v1.2.1