forked from qt-creator/qt-creator
CrashHandler: Opt-in instead of Opt-out
Enable the crash handler by defining the environment variable QTC_USE_CRASH_HANDLER=1 (evaluated on start up). Change-Id: Ib7f9fa016ab24a15082fbd90fd334bd4f2b17234 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
@@ -127,10 +127,8 @@ void CrashHandlerDialog::setApplicationInfo(const QString &signalName)
|
|||||||
const QString title = tr("%1 has closed unexpectedly (Signal \"%2\")").arg(ideName, signalName);
|
const QString title = tr("%1 has closed unexpectedly (Signal \"%2\")").arg(ideName, signalName);
|
||||||
const QString introLabelContents = tr(
|
const QString introLabelContents = tr(
|
||||||
"<p><b>%1.</b></p>"
|
"<p><b>%1.</b></p>"
|
||||||
"<p>Please file a <a href='%2'>bug report</a> with the debug information provided below.</p>"
|
"<p>Please file a <a href='%2'>bug report</a> with the debug information provided below.</p>")
|
||||||
"<p>Hint: Deactivate this Crash Handler by adding QTC_NO_CRASH_HANDLER=1<br/>"
|
.arg(title, QLatin1String(URL_BUGTRACKER));
|
||||||
"to the environment (evaluated on startup of %3).</p>")
|
|
||||||
.arg(title, QLatin1String(URL_BUGTRACKER), ideName);
|
|
||||||
m_ui->introLabel->setText(introLabelContents);
|
m_ui->introLabel->setText(introLabelContents);
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#ifdef BUILD_CRASH_HANDLER
|
#ifdef BUILD_CRASH_HANDLER
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDebug>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -83,7 +82,7 @@ extern "C" void signalHandler(int signal)
|
|||||||
void setupCrashHandler()
|
void setupCrashHandler()
|
||||||
{
|
{
|
||||||
#ifdef BUILD_CRASH_HANDLER
|
#ifdef BUILD_CRASH_HANDLER
|
||||||
if (!qgetenv("QTC_NO_CRASH_HANDLER").isEmpty())
|
if (qgetenv("QTC_USE_CRASH_HANDLER").isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const QString crashHandlerPath = qApp->applicationDirPath()
|
const QString crashHandlerPath = qApp->applicationDirPath()
|
||||||
|
|||||||
Reference in New Issue
Block a user