diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-04-21 19:06:44 +0200 |
---|---|---|
committer | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2020-12-05 19:25:48 +0300 |
commit | f67e4da406f8753fb041705cf197690e7fd9a0aa (patch) | |
tree | 6c81ee3dcf0685eb1c19deb3badad8636225f80c /desktop | |
parent | Remove collect usage info from GUI (diff) | |
download | core-f67e4da406f8753fb041705cf197690e7fd9a0aa.tar.gz core-f67e4da406f8753fb041705cf197690e7fd9a0aa.zip |
Some optimisations around crashreporter status queries
* make dump enable status query static
* only offer crash UI if dump is enabled
Change-Id: I71aff4c6ca5a73e4d1db6163cdf8dec75b9e7538
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 3 | ||||
-rw-r--r-- | desktop/source/app/crashreport.cxx | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index e5d0939b2e93..60bee01beadf 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2007,7 +2007,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 5d48593c42cb..2d14c32ae6b3 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; } |