diff options
author | Mert Tumer <mert.tumer@collabora.com> | 2021-12-13 16:08:32 +0300 |
---|---|---|
committer | Mert Tümer <merttumer@outlook.com> | 2021-12-14 18:57:13 +0300 |
commit | 5d7cfcd86146ab349e2bf1b4fb397d28e6880ac7 (patch) | |
tree | 1fbbab0e9be3d326250c376cbdea24cf79f733b4 /kit | |
parent | Hide cursor during zoom animation #3758 (diff) | |
download | online-5d7cfcd86146ab349e2bf1b4fb397d28e6880ac7.tar.gz online-5d7cfcd86146ab349e2bf1b4fb397d28e6880ac7.zip |
check if we save-as successfully before proceed with downloadas
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I77c76f424a5767a19be812f35dfadf9e56cbfb20
Diffstat (limited to 'kit')
-rw-r--r-- | kit/ChildSession.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index e48a6f2df3..1b20974a11 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1113,10 +1113,17 @@ bool ChildSession::downloadAs(const char* /*buffer*/, int /*length*/, const Stri (format.empty() ? "(nullptr)" : format.c_str()) << "', ' filterOptions=" << (filterOptions.empty() ? "(nullptr)" : filterOptions.c_str()) << "'."); - getLOKitDocument()->saveAs(url.c_str(), + bool success = getLOKitDocument()->saveAs(url.c_str(), format.empty() ? nullptr : format.c_str(), filterOptions.empty() ? nullptr : filterOptions.c_str()); + if (!success) + { + LOG_ERR("SaveAs Failed for id=" << id << " [" << url << "]. error= " << getLOKitLastError()); + sendTextFrameAndLogError("error: cmd=downloadas kind=saveasfailed"); + return false; + } + // Register download id -> URL mapping in the DocumentBroker std::string docBrokerMessage = "registerdownload: downloadid=" + tmpDir + " url=" + urlToSend; _docManager->sendFrame(docBrokerMessage.c_str(), docBrokerMessage.length()); |