KCrash Class Reference
This class handles segmentation-faults. More...
#include <kcrash.h>
Public Types | |
typedef void(* | HandlerType )(int) |
This function type is a pointer to a crash handler function. | |
Static Public Member Functions | |
void | defaultCrashHandler (int signal) |
The default crash handler. | |
void | setCrashHandler (HandlerType handler=defaultCrashHandler) |
Install a function to be called in case a SIGSEGV is caught. | |
HandlerType | crashHandler () |
Returns the installed crash handler. | |
void | setEmergencySaveFunction (HandlerType saveFunction=(HandlerType) 0) |
Installs a function which should try to save the applications data. | |
HandlerType | emergencySaveFunction () |
Return the currently set emergency save function. | |
void | setApplicationPath (QString path) |
Sets the application path which should be passed to Dr. | |
void | setApplicationName (QString name) |
Sets the application name name which should be passed to Dr. | |
Static Protected Attributes | |
HandlerType | _crashHandler = 0 |
Pointer to the crash handler. | |
HandlerType | _emergencySaveFunction = 0 |
Pointer to the emergency save function. |
Detailed Description
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 setCrashHandler(). If a function is specified with setEmergencySaveFunction() it will be called by the default crash handler, giving the application a chance to save its data.
Definition at line 36 of file kcrash.h.
Member Typedef Documentation
|
This function type is a pointer to a crash handler function. The function's argument is the number of the signal. Definition at line 53 of file kcrash.h. Referenced by crashHandler(), emergencySaveFunction(), setCrashHandler(), and setEmergencySaveFunction(). |
Member Function Documentation
|
The default crash handler.
Definition at line 108 of file kcrash.cpp. References _emergencySaveFunction, KInstance::aboutData(), KAboutData::bugAddress(), KStdAction::close(), DCOPClient::emergencyClose(), KNotifyClient::instance(), QString::isNull(), KAboutData::programName(), QCString::setNum(), QString::utf8(), and KAboutData::version(). Referenced by setEmergencySaveFunction(). |
|
Install a function to be called in case a SIGSEGV is caught.
Definition at line 77 of file kcrash.cpp. References _crashHandler, and HandlerType. |
|
Returns the installed crash handler.
Definition at line 72 of file kcrash.h. References _crashHandler, and HandlerType. |
|
Installs a function which should try to save the applications data. 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.
Definition at line 61 of file kcrash.cpp. References _crashHandler, _emergencySaveFunction, defaultCrashHandler(), and HandlerType. |
|
Return the currently set emergency save function.
Definition at line 86 of file kcrash.h. References _emergencySaveFunction, and HandlerType. |
|
Sets the application Konqi, our nice crash display application.
Definition at line 93 of file kcrash.h. References QString::local8Bit(). |
|
Sets the application name Konqi, our nice crash display application.
Definition at line 100 of file kcrash.h. References KStdAction::name(). |
Member Data Documentation
|
Pointer to the crash handler.
Definition at line 53 of file kcrash.cpp. Referenced by crashHandler(), setCrashHandler(), and setEmergencySaveFunction(). |
|
Pointer to the emergency save function.
Definition at line 52 of file kcrash.cpp. Referenced by defaultCrashHandler(), emergencySaveFunction(), and setEmergencySaveFunction(). |
The documentation for this class was generated from the following files: