From a8b41b0cbb855e56a56f44c8254cacdc8518a990 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 11 Jul 2018 12:08:53 +0300 Subject: [PATCH] Log also when retrying the saveAs Although, at least for me, after calling LOK's saveAs with an intentionally bogus file extension 'file:///user/docs/u0.frobozz' retrying with 'file:///user/docs/u0.frobozz.odt' does not work either. Actually, I am not sure how useful this retry feature is as it is now. If the user tries to save as some unsupported format, why can we assume that maybe they want to save in some other format instead, and possibly overwrite an existing file? Maybe the retry should be done only if the file name to saveAs was without extension? But that was already discussed in gerrit, I see. Change-Id: I8bd4fbf241cb492d9654ae893af4baaf28b6b3a0 --- kit/ChildSession.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index a09968a93..d56a81597 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1187,6 +1187,10 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const std::vec if (retry) { + LOG_DBG("Retry: calling LOK's saveAs with: '" << url.c_str() << "', '" << + (format.size() == 0 ? "(nullptr)" : format.c_str()) << "', '" << + (filterOptions.size() == 0 ? "(nullptr)" : filterOptions.c_str()) << "'."); + success = getLOKitDocument()->saveAs(url.c_str(), format.size() == 0 ? nullptr :format.c_str(), filterOptions.size() == 0 ? nullptr : filterOptions.c_str());