desktop/source/app/app.cxx | 3 ++- desktop/source/app/crashreport.cxx | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-)
New commits: commit 3ea5024328dea554c24fac6de7f132c1d10d1222 Author: Thorsten Behrens <thorsten.behr...@cib.de> AuthorDate: Tue Apr 21 19:06:44 2020 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Sep 5 19:15:28 2023 +0200 Some optimisations around crashreporter status queries * make dump enable status query static * only offer crash UI if dump is enabled cherry-pick from commit: f67e4da406f8753fb041705cf197690e7fd9a0aa Change-Id: I71aff4c6ca5a73e4d1db6163cdf8dec75b9e7538 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156490 Reviewed-by: Gabor Kelemen <kelem...@ubuntu.com> Tested-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index b205d5b189e1..a4c249b445a8 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1987,7 +1987,8 @@ void Desktop::OpenClients() #endif #if HAVE_FEATURE_BREAKPAD - if (officecfg::Office::Common::Misc::CrashReport::get() && CrashReporter::crashReportInfoExists()) + if (CrashReporter::IsDumpEnable() && + officecfg::Office::Common::Misc::CrashReport::get() && CrashReporter::crashReportInfoExists()) handleCrashReport(); #endif diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 0458edf9793a..b8754c53f706 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -279,13 +279,21 @@ bool CrashReporter::IsDumpEnable() if (env != nullptr && env[0] != '\0') { return true; } + + static bool bConfigRead = false; + static bool bEnable = true; // default, always on + + if (bConfigRead) + return bEnable; + // read configuration item 'CrashDumpEnable' -> bool on/off OUString sToken; if (rtl::Bootstrap::get("CrashDumpEnable", sToken)) { - return sToken.toBoolean(); + bEnable = sToken.toBoolean(); } - return true; // default, always on + bConfigRead = true; + return bEnable; }