KDEUI
KCrash Namespace Reference
This class handles segmentation-faults. More...
Typedefs | |
typedef void(* | HandlerType )(int) |
Enumerations | |
enum | CrashFlag { KeepFDs = 1, SaferDialog = 2, AlwaysDirectly = 4, AutoRestart = 8 } |
Functions | |
HandlerType | crashHandler () |
void | defaultCrashHandler (int signal) |
HandlerType | emergencySaveFunction () |
void | setApplicationName (const QString &name) |
void | setApplicationPath (const QString &path) |
void | setCrashHandler (HandlerType handler=defaultCrashHandler) |
void | setEmergencySaveFunction (HandlerType saveFunction=0) |
void | setFlags (CrashFlags flags) |
void | startDirectly (const char *argv[], int argc) |
void | startDrKonqi (const char *argv[], int argc) |
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.
Typedef Documentation
typedef void(* KCrash::HandlerType)(int) |
Enumeration Type Documentation
enum KCrash::CrashFlag |
Options to determine how KCrash should behave while firing up DrKonqi.
Function Documentation
KCrash::HandlerType KCrash::crashHandler | ( | ) |
Returns the installed crash handler.
- Returns:
- the crash handler
Definition at line 195 of file kcrash.cpp.
void KCrash::defaultCrashHandler | ( | int | signal | ) |
The default crash handler.
- Parameters:
-
signal the signal number
Definition at line 211 of file kcrash.cpp.
KCrash::HandlerType KCrash::emergencySaveFunction | ( | ) |
Return the currently set emergency save function.
- Returns:
- the emergency save function
Definition at line 98 of file kcrash.cpp.
void KCrash::setApplicationName | ( | const 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
Definition at line 150 of file kcrash.cpp.
void KCrash::setApplicationPath | ( | const QString & | path | ) |
Sets the application path
which should be passed to Dr.
Konqi, our nice crash display application.
- Parameters:
-
path the application path.
Definition at line 144 of file kcrash.cpp.
void KCrash::setCrashHandler | ( | 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);
handler the crash handler
Definition at line 159 of file kcrash.cpp.
void KCrash::setEmergencySaveFunction | ( | 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
Definition at line 83 of file kcrash.cpp.
void KCrash::setFlags | ( | CrashFlags | flags | ) |
Set DrKonqi fire-up options.
- Parameters:
-
flags ORed together CrashFlags
void KCrash::startDirectly | ( | const char * | argv[], | |
int | argc | |||
) |
Definition at line 417 of file kcrash.cpp.
void KCrash::startDrKonqi | ( | const char * | argv[], | |
int | argc | |||
) |
Definition at line 362 of file kcrash.cpp.