class KCrash

# class KCrash | This class handles segmentation-faults. More...
Definition | `#include <kcrash.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Static Methods

- 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 setApplicationPath (QString path)
- static void setApplicationName (QString name)

#### Public Members

- typedef void (*HandlerType) (int)

#### Protected Members

- static HandlerType _crashHandler
- static HandlerType _emergencySaveFunction

## 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.

void defaultCrashHandler (int signal) | ### defaultCrashHandler

[static]

The default crash handler.

Parameters:

signal | the signal number

typedef void (*HandlerType) (int) | ### (*HandlerType)

This function type is a pointer to a crash handler function. The function's argument is the number of the signal.

void setCrashHandler (HandlerType handler = defaultCrashHandler) | ### setCrashHandler

[static]

Install a function to be called in case a SIGSEGV is caught.

- 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);

Parameters:

HandlerType | handler can be one of
handler | the crash handler

HandlerType crashHandler () | ### crashHandler

[static]

Returns the installed crash handler.

Returns: the crash handler

void setEmergencySaveFunction (HandlerType saveFunction = (HandlerType)0) | ### 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

HandlerType emergencySaveFunction () | ### emergencySaveFunction

[static]

Return the currently set emergency save function.

Returns: the emergency save function

void setApplicationPath (QString path) | ### setApplicationPath

[static]

Sets the application `path` which should be passed to Dr. Konqi, our nice crash display application.

Parameters:

path | the application path.

void setApplicationName (QString name) | ### setApplicationName

[static]

Sets the application name `name` which should be passed to Dr. Konqi, our nice crash display application.

Parameters:

name | the name of the application, as shown in Dr. Konqi

static HandlerType _crashHandler | ### _crashHandler

[protected]

static HandlerType _emergencySaveFunction | ### _emergencySaveFunction

[protected]

Generated by: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:15 2003, using kdoc 2.0a54.