From 4d03ef2daee507dfe5edc3db8ab32c857f5692f4 Mon Sep 17 00:00:00 2001 From: Andrea Di Menna Date: Fri, 7 Oct 2011 00:18:13 +0200 Subject: 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 --- src/mainwindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mainwindow.cpp') 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(); -- cgit v1.2.1