diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2023-12-05 12:35:08 +0100 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2023-12-05 18:06:51 +0100 |
commit | 7f49fa220225d2afbefac756a03586212d8ce1c6 (patch) | |
tree | 2ebb46a80a464678036013a643ee625fe85c78e3 /desktop | |
parent | e507fd525404d5ac078a47650df11e5e18a88a81 (diff) |
Make --enable-online-update=mar at least compile again, on Linux
Seen it build (but no idea yet whether it actually would work) with
autogen.input including
> --enable-online-update=mar
> --with-update-config=/home/sberg/lo/update.ini
and ~/lo/update.ini containing
> [Updater]
> ServerURL=TODO
> base-url=TODO
> certificate-der=/home/sberg/lo/certificate.der
> certificate-name=TODO
> certificate-path=TODO
> channel=TODO
> upload-url=TODO
and ~/lo/certificate.der containing
> TODO
Change-Id: Ib40417c09c6454fe9cf678c029a06716415e5cb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160339
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 1 | ||||
-rw-r--r-- | desktop/source/app/updater.cxx | 20 |
2 files changed, 11 insertions, 10 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cd1d1de0d6ea..4c13a2a8e716 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -118,6 +118,7 @@ #include <svl/eitem.hxx> #include <basic/sbstar.hxx> #include <desktop/crashreport.hxx> +#include <tools/time.hxx> #include <tools/urlobj.hxx> #include <comphelper/diagnose_ex.hxx> #include <svtools/fontsubstconfig.hxx> diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index edac2cb38350..1af82cf85fc9 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -36,7 +36,6 @@ #include <orcus/json_document_tree.hpp> #include <orcus/config.hpp> -#include <orcus/pstring.hpp> #include <systools/curlinit.hxx> #include <comphelper/hash.hxx> @@ -48,6 +47,7 @@ #include <functional> #include <memory> #include <set> +#include <string_view> namespace { @@ -391,9 +391,9 @@ public: } }; -OUString toOUString(const std::string& rStr) +OUString toOUString(const std::string_view& rStr) { - return OUString::fromUtf8(rStr.c_str()); + return OUString::fromUtf8(rStr); } update_file parse_update_file(orcus::json::node& rNode) @@ -422,12 +422,12 @@ update_file parse_update_file(orcus::json::node& rNode) } update_file aUpdateFile; - aUpdateFile.aURL = toOUString(aURLNode.string_value().str()); + aUpdateFile.aURL = toOUString(aURLNode.string_value()); if (aUpdateFile.aURL.isEmpty()) throw invalid_update_info(); - aUpdateFile.aHash = toOUString(aHashNode.string_value().str()); + aUpdateFile.aHash = toOUString(aHashNode.string_value()); aUpdateFile.nSize = static_cast<sal_uInt32>(aSizeNode.numeric_value()); return aUpdateFile; } @@ -454,7 +454,7 @@ update_info parse_response(const std::string& rResponse) { update_info aUpdateInfo; auto aMsgNode = aDocumentRoot.child("response"); - aUpdateInfo.aMessage = toOUString(aMsgNode.string_value().str()); + aUpdateInfo.aMessage = toOUString(aMsgNode.string_value()); return aUpdateInfo; } @@ -483,17 +483,17 @@ update_info parse_response(const std::string& rResponse) } update_info aUpdateInfo; - aUpdateInfo.aFromBuildID = toOUString(aFromNode.string_value().str()); - aUpdateInfo.aSeeAlsoURL = toOUString(aSeeAlsoNode.string_value().str()); + aUpdateInfo.aFromBuildID = toOUString(aFromNode.string_value()); + aUpdateInfo.aSeeAlsoURL = toOUString(aSeeAlsoNode.string_value()); aUpdateInfo.aUpdateFile = parse_update_file(aUpdateNode); - std::vector<orcus::pstring> aLanguages = aLanguageNode.keys(); + std::vector<std::string_view> aLanguages = aLanguageNode.keys(); for (auto const& language : aLanguages) { language_file aLanguageFile; auto aLangEntry = aLanguageNode.child(language); - aLanguageFile.aLangCode = toOUString(language.str()); + aLanguageFile.aLangCode = toOUString(language); aLanguageFile.aUpdateFile = parse_update_file(aLangEntry); aUpdateInfo.aLanguageFiles.push_back(aLanguageFile); } |