KDE 4.4 PyKDE API Reference

- KDE's Python API

# KCrash Namespace Reference

`from PyKDE4.kdeui.KCrash import *`

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

## Enumerations
CrashFlag | { KeepFDs, SaferDialog, AlwaysDirectly, AutoRestart }
## Functions
KCrash.HandlerType | crashHandler ()
| defaultCrashHandler (, int signal)
KCrash.HandlerType | emergencySaveFunction ()
| setApplicationName (, QString name)
| setApplicationPath (, QString path)
| setCrashHandler (, KCrash.HandlerType handler=defaultCrashHandler)
| setEmergencySaveFunction (, KCrash.HandlerType saveFunction=0)
| setFlags (, KCrash.CrashFlags flags)

## Enumeration Documentation

CrashFlag

Options to determine how KCrash should behave while firing up DrKonqi.

Enumerator:

  KeepFDs = 1 |
  SaferDialog = 2 |
  AlwaysDirectly = 4 |
  AutoRestart = 8 |

## Function Documentation

KCrash.HandlerType crashHandler | ( |  | ) |

Returns the installed crash handler.

Returns:
  the crash handler

defaultCrashHandler | ( | int | signal
| ) |  |  |

The default crash handler.

Parameters:

  | signal | the signal number

KCrash.HandlerType emergencySaveFunction | ( |  | ) |

Return the currently set emergency save function.

Returns:
  the emergency save function

setApplicationName | ( | QString | name
| ) |  |  |

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

setApplicationPath | ( | QString | path
| ) |  |  |

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

Parameters:

  | path | the application path.

setCrashHandler | ( | KCrash.HandlerType | handler=defaultCrashHandler
| ) |  |  |

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

Parameters:

  | handler | the crash handler

setEmergencySaveFunction | ( | KCrash.HandlerType | saveFunction=0
| ) |  |  |

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

setFlags | ( | KCrash.CrashFlags | flags
| ) |  |  |

Set DrKonqi fire-up options.

Parameters:

  | flags | ORed together CrashFlags