summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Di Menna <ninniuz@gmail.com>2011-10-07 00:18:13 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-10-07 00:18:13 +0200
commit4d03ef2daee507dfe5edc3db8ab32c857f5692f4 (patch)
tree3ae960d220122137b5e6c4edd30e5ffafe9b17d1 /src
parentuse language, NOT country!!! (diff)
downloadrekonq-4d03ef2daee507dfe5edc3db8ab32c857f5692f4.tar.xz
Use KPart url when some KPart is active on saving
When the Save As action is invoked on a KParts document (e.g. view source katepart) the WebTab's url is used to: 1) set the filename in KFileDialog 2) set the src url for the kio copy job The url is empty in such cases and the save action fails. I have changed the srcUrl to be the url set for the KParts document. REVIEW: 102768 REVIEWED-BY: adjam
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 528ec217..f0df00e8 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -638,6 +638,17 @@ void MainWindow::fileSaveAs()
WebTab *w = currentTab();
KUrl srcUrl = w->url();
+ if (currentTab()->page()->isOnRekonqPage())
+ {
+ KParts::ReadOnlyPart *p = currentTab()->part();
+ if (p)
+ {
+ // if this is a KParts document then the w->url() will be empty and the srcUrl
+ // must be set to the document url
+ srcUrl = p->url();
+ }
+ }
+
// First, try with suggested file name...
QString name = w->page()->suggestedFileName();