diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-04-21 19:06:44 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-04-21 19:09:46 +0200 |
commit | c929f04eadd8694819a0f5c7fd622d709e9dc88e (patch) | |
tree | ed6d0d01fbe874d685fe61f9bfadbf661e037874 | |
parent | daa45d73b67632808fb5fbbafa0d6f187f53c586 (diff) |
Some optimisations around crashreporter status queries
* make dump enable status query static
* only offer crash UI if dump is enabled
Change-Id: I71aff4c6ca5a73e4d1db6163cdf8dec75b9e7538
-rw-r--r-- | desktop/source/app/app.cxx | 2 | ||||
-rw-r--r-- | desktop/source/app/crashreport.cxx | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index c9dbcca1b290..202285287a78 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2010,7 +2010,7 @@ void Desktop::OpenClients() #endif #if HAVE_FEATURE_BREAKPAD - if (CrashReporter::crashReportInfoExists()) + if (CrashReporter::IsDumpEnable() && CrashReporter::crashReportInfoExists()) handleCrashReport(); #endif diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 379dfa38defd..c90a584a4163 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -231,15 +231,21 @@ void CrashReporter::removeExceptionHandler() bool CrashReporter::IsDumpEnable() { + static bool bConfigRead = false; + static bool bEnable = true; // default, always on + + if (bConfigRead) + return bEnable; + OUString sToken; OString sEnvVar(std::getenv("CRASH_DUMP_ENABLE")); - bool bEnable = true; // default, always on // read configuration item 'CrashDumpEnable' -> bool on/off if (rtl::Bootstrap::get("CrashDumpEnable", sToken) && sEnvVar.isEmpty()) { bEnable = sToken.toBoolean(); } + bConfigRead = true; return bEnable; } |