.TH "KCrash" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCrash \- This class handles segmentation-faults.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kcrash.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef void(* \fBHandlerType\fP )(int)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static void \fBdefaultCrashHandler\fP (int signal)"
.br
.ti -1c
.RI "static void \fBsetCrashHandler\fP (\fBHandlerType\fP handler=defaultCrashHandler)"
.br
.ti -1c
.RI "static \fBHandlerType\fP \fBcrashHandler\fP ()"
.br
.ti -1c
.RI "static void \fBsetEmergencySaveFunction\fP (\fBHandlerType\fP saveFunction=(\fBHandlerType\fP) 0)"
.br
.ti -1c
.RI "static \fBHandlerType\fP \fBemergencySaveFunction\fP ()"
.br
.ti -1c
.RI "static void \fBsetSafer\fP (bool on)"
.br
.ti -1c
.RI "static void \fBsetApplicationPath\fP (\fBQString\fP path)"
.br
.ti -1c
.RI "static void \fBsetApplicationName\fP (\fBQString\fP name)"
.br
.in -1c
.SS "Static Protected Attributes"

.in +1c
.ti -1c
.RI "static \fBHandlerType\fP \fB_crashHandler\fP = 0"
.br
.ti -1c
.RI "static \fBHandlerType\fP \fB_emergencySaveFunction\fP = 0"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class handles segmentation-faults. 

By default it displays a message-box saying the application crashed. This default can be overridden by setting a custom crash handler with \fBsetCrashHandler()\fP. If a function is specified with \fBsetEmergencySaveFunction()\fP it will be called by the default crash handler, giving the application a chance to save its data. 
.PP
Definition at line 37 of file kcrash.h.
.SH "Member Typedef Documentation"
.PP 
.SS "typedef void(* \fBKCrash::HandlerType\fP)(int)"
.PP
This function type is a pointer to a crash handler function. 
.PP
The function's argument is the number of the signal. 
.PP
Definition at line 55 of file kcrash.h.
.SH "Member Function Documentation"
.PP 
.SS "void KCrash::defaultCrashHandler (int signal)\fC [static]\fP"
.PP
The default crash handler. 
.PP
\fBParameters:\fP
.RS 4
\fIsignal\fP the signal number 
.RE
.PP

.PP
Definition at line 113 of file kcrash.cpp.
.PP
References _emergencySaveFunction, KInstance::aboutData(), KAboutData::bugAddress(), DCOPClient::emergencyClose(), QString::isNull(), KAboutData::programName(), QCString::setNum(), QString::utf8(), and KAboutData::version().
.PP
Referenced by setEmergencySaveFunction().
.SS "void KCrash::setCrashHandler (\fBHandlerType\fP handler = \fCdefaultCrashHandler\fP)\fC [static]\fP"
.PP
Install a function to be called in case a SIGSEGV is caught. 
.PP
\fBParameters:\fP
.RS 4
\fIhandler\fP HandlerType handler can be one of 
.PD 0

.IP "\(bu" 2
null in which case signal-catching is disabled (by calling signal(SIGSEGV, SIG_DFL)) 
.IP "\(bu" 2
if handler is omitted the default crash handler is installed. 
.IP "\(bu" 2
an user defined function in the form: static (if in a class) void myCrashHandler(int); 
.PP
.br
\fIhandler\fP the crash handler 
.RE
.PP

.PP
Definition at line 80 of file kcrash.cpp.
.PP
References _crashHandler.
.SS "static \fBHandlerType\fP KCrash::crashHandler ()\fC [inline, static]\fP"
.PP
Returns the installed crash handler. 
.PP
\fBReturns:\fP
.RS 4
the crash handler 
.RE
.PP

.PP
Definition at line 74 of file kcrash.h.
.SS "void KCrash::setEmergencySaveFunction (\fBHandlerType\fP saveFunction = \fC(\fBHandlerType\fP) 0\fP)\fC [static]\fP"
.PP
Installs a function which should try to save the applications data. 
.PP
It is the crash handler´s responsibility to call this function. Therefore, if no crash handler is set, the default crash handler is installed to ensure the save function is called. 
.PP
\fBParameters:\fP
.RS 4
\fIsaveFunction\fP the handler to install 
.RE
.PP

.PP
Definition at line 64 of file kcrash.cpp.
.PP
References _crashHandler, _emergencySaveFunction, and defaultCrashHandler().
.SS "static \fBHandlerType\fP KCrash::emergencySaveFunction ()\fC [inline, static]\fP"
.PP
Return the currently set emergency save function. 
.PP
\fBReturns:\fP
.RS 4
the emergency save function 
.RE
.PP

.PP
Definition at line 88 of file kcrash.h.
.SS "static void KCrash::setSafer (bool on)\fC [inline, static]\fP"
.PP
Set whether to start drkonqi without arbitrary disk access. 
.PP
Definition at line 93 of file kcrash.h.
.SS "static void KCrash::setApplicationPath (\fBQString\fP path)\fC [inline, static]\fP"
.PP
Sets the application \fCpath\fP which should be passed to Dr. 
.PP
Konqi, our nice crash display application. 
.PP
\fBParameters:\fP
.RS 4
\fIpath\fP the application path. 
.RE
.PP

.PP
Definition at line 100 of file kcrash.h.
.PP
References QString::local8Bit().
.SS "static void KCrash::setApplicationName (\fBQString\fP name)\fC [inline, static]\fP"
.PP
Sets the application name \fCname\fP which should be passed to Dr. 
.PP
Konqi, our nice crash display application. 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the application, as shown in Dr. Konqi 
.RE
.PP

.PP
Definition at line 108 of file kcrash.h.
.PP
References QString::local8Bit().
.SH "Member Data Documentation"
.PP 
.SS "\fBKCrash::HandlerType\fP \fBKCrash::_crashHandler\fP = 0\fC [static, protected]\fP"
.PP
Pointer to the crash handler. 
.PP
Definition at line 55 of file kcrash.cpp.
.PP
Referenced by setCrashHandler(), and setEmergencySaveFunction().
.SS "\fBKCrash::HandlerType\fP \fBKCrash::_emergencySaveFunction\fP = 0\fC [static, protected]\fP"
.PP
Pointer to the emergency save function. 
.PP
Definition at line 54 of file kcrash.cpp.
.PP
Referenced by defaultCrashHandler(), and setEmergencySaveFunction().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
