diff options
author | Andrea Di Menna <ninniuz@gmail.com> | 2011-10-07 00:18:13 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-10-07 00:18:13 +0200 |
commit | 4d03ef2daee507dfe5edc3db8ab32c857f5692f4 (patch) | |
tree | 3ae960d220122137b5e6c4edd30e5ffafe9b17d1 | |
parent | use language, NOT country!!! (diff) | |
download | rekonq-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
-rw-r--r-- | src/mainwindow.cpp | 11 |
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(); |