diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-29 12:15:18 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-30 08:16:38 +0000 |
commit | 7259f07deaa9f9d5ce5c5b0f8f0847c673449135 (patch) | |
tree | e50d803589b46edf21076852f1f5cd9efafa0b34 | |
parent | 4d4be0c0f1fd1c9bdfe815eddd0ff6b49b5bba39 (diff) |
use the existing URL to path tools
Change-Id: I20aa47556205f5efc70f8f5ea39c63009110f986
Reviewed-on: https://gerrit.libreoffice.org/25646
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | include/sal/config.h | 4 | ||||
-rw-r--r-- | svx/source/dialog/crashreportdlg.cxx | 17 |
2 files changed, 13 insertions, 8 deletions
diff --git a/include/sal/config.h b/include/sal/config.h index ea3e897c003f..29fe63bf9837 100644 --- a/include/sal/config.h +++ b/include/sal/config.h @@ -29,6 +29,7 @@ #ifdef _WIN32 #define SAL_W32 #define SAL_DLLEXTENSION ".dll" +#define SAL_EXEEXTENSION ".exe" #define SAL_PATHSEPARATOR ';' #define SAL_PATHDELIMITER '\\' #define SAL_NEWLINE_STRING "\r\n" @@ -56,6 +57,7 @@ defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(ANDROID) #define SAL_UNX #define SAL_DLLEXTENSION ".so" +#define SAL_EXEEXTENSION "" #define SAL_DLLPREFIX "lib" #define SAL_PATHSEPARATOR ':' #define SAL_PATHDELIMITER '/' @@ -66,6 +68,7 @@ #ifdef EMSCRIPTEN #define SAL_UNX #define SAL_DLLEXTENSION ".bc" +#define SAL_EXEEXTENSION "" #define SAL_DLLPREFIX "lib" #define SAL_PATHSEPARATOR ':' #define SAL_PATHDELIMITER '/' @@ -76,6 +79,7 @@ #ifdef MACOSX #define SAL_UNX #define SAL_DLLEXTENSION ".dylib" +#define SAL_EXEEXTENSION "" #define SAL_DLLPREFIX "lib" #define SAL_PATHSEPARATOR ':' #define SAL_PATHDELIMITER '/' diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index a3ac1d940670..aeb5c14fb192 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -13,6 +13,7 @@ #include <rtl/bootstrap.hxx> #include <desktop/crashreport.hxx> +#include <osl/file.hxx> CrashReportDialog::CrashReportDialog(vcl::Window* pParent): Dialog(pParent, "CrashReportDialog", @@ -40,12 +41,12 @@ void CrashReportDialog::dispose() namespace { -OString getLibDir() +OUString getLibDir() { OUString aOriginal = "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER; rtl::Bootstrap::expandMacros(aOriginal); - return rtl::OUStringToOString(aOriginal, RTL_TEXTENCODING_UTF8); + return aOriginal; } } @@ -55,12 +56,12 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) if (pBtn == mpBtnSend.get()) { std::string ini_path = CrashReporter::getIniFileName(); -#if defined WNT - OString aCommand = getLibDir().copy(8) + "/minidump_upload.exe " + ini_path.c_str(); -#else - OString aCommand = getLibDir().copy(7) + "/minidump_upload " + ini_path.c_str(); -#endif - int retVal = std::system(aCommand.getStr()); + OUString aCommand; + osl::FileBase::getSystemPathFromFileURL(getLibDir() + "/minidump_upload" + SAL_EXEEXTENSION, aCommand); + + aCommand = aCommand; + OString aOStringCommand = rtl::OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8) + " " + ini_path.c_str(); + int retVal = std::system(aOStringCommand.getStr()); SAL_WARN_IF(retVal != 0, "svx.dialog", "Failed to upload minidump. Error Code: " << retVal); // TODO: moggi: return the id for the user to look it up Close(); |