#include <kcrash.h>
Public Types | |
typedef void(* | HandlerType) (int) |
Static Public Member Functions | |
static void | defaultCrashHandler (int signal) |
static void | setCrashHandler (HandlerType handler=defaultCrashHandler) |
static HandlerType | crashHandler () |
static void | setEmergencySaveFunction (HandlerType saveFunction=(HandlerType) 0) |
static HandlerType | emergencySaveFunction () |
static void | setSafer (bool on) |
static void | setApplicationPath (TQString path) |
static void | setApplicationName (TQString name) |
Static Protected Attributes | |
static HandlerType | _crashHandler = 0 |
static HandlerType | _emergencySaveFunction = 0 |
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.
Member Typedef Documentation
◆ HandlerType
typedef void(* TDECrash::HandlerType) (int) |
Member Function Documentation
◆ crashHandler()
|
inlinestatic |
◆ defaultCrashHandler()
|
static |
The default crash handler.
- Parameters
-
signal the signal number
Definition at line 119 of file kcrash.cpp.
◆ emergencySaveFunction()
|
inlinestatic |
◆ setApplicationName()
|
inlinestatic |
◆ setApplicationPath()
|
inlinestatic |
◆ setCrashHandler()
|
static |
Install a function to be called in case a SIGSEGV is caught.
- Parameters
-
handler HandlerType handler can be one of - null in which case signal-catching is disabled (by calling signal(SIGSEGV, SIG_DFL))
- if handler is omitted the default crash handler is installed.
- an user defined function in the form: static (if in a class) void myCrashHandler(int);
handler the crash handler
Definition at line 86 of file kcrash.cpp.
◆ setEmergencySaveFunction()
|
static |
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.
- Parameters
-
saveFunction the handler to install
Definition at line 70 of file kcrash.cpp.
◆ setSafer()
|
inlinestatic |
Member Data Documentation
◆ _crashHandler
|
staticprotected |
◆ _emergencySaveFunction
|
staticprotected |
The documentation for this class was generated from the following files: