diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-04-19 12:30:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-19 13:53:48 +0000 |
commit | 024d2fde2aae13b07cf5c7b4d85fc3c6abce6913 (patch) | |
tree | 718a2522eb135a3aac533338d221c0d827e373d6 /desktop | |
parent | cac70559013e575009657aa3c5168b88b1f14691 (diff) |
In lok_init_2, allow vnd.sun.star.pathname user_profile_url
...which takes a raw filesystem pathname that is internally converted to a file
URL (similarly to what is supported for the INIFILENAME and URE_BOOTSTRAP
bootstrap variables in rtl::Bootstrap). That way, the gtktiledviewer executable
doesn't need to try convert a pathname into a URL.
Also adapted various parameter names to make it obvious that URLs get passed,
not pathnames.
Change-Id: I33ab31fe142d94ee47885033ef48278ef5ff55a2
Reviewed-on: https://gerrit.libreoffice.org/24241
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b58f23e14691..0f46a04621dc 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1816,7 +1816,7 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit: } } -static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfilePath) +static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl) { enum { PRE_INIT, // setup shared data in master process @@ -1849,8 +1849,23 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char if (eStage != PRE_INIT) comphelper::LibreOfficeKit::setStatusIndicatorCallback(lo_status_indicator_callback, pLib); - if (eStage != SECOND_INIT && pUserProfilePath) - rtl::Bootstrap::set("UserInstallation", OUString(pUserProfilePath, strlen(pUserProfilePath), RTL_TEXTENCODING_UTF8)); + if (eStage != SECOND_INIT && pUserProfileUrl) + { + OUString url( + pUserProfileUrl, strlen(pUserProfileUrl), RTL_TEXTENCODING_UTF8); + OUString path; + if (url.startsWithIgnoreAsciiCase("vnd.sun.star.pathname:", &path)) + { + OUString url2; + osl::FileBase::RC e = osl::FileBase::getFileURLFromSystemPath( + path, url2); + if (e == osl::FileBase::E_None) + url = url2; + else + SAL_WARN("lok", "resolving <" << url << "> failed with " << +e); + } + rtl::Bootstrap::set("UserInstallation", url); + } OUString aAppPath; if (pAppPath) |