• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KCrash Namespace Reference


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.


Typedefs

typedef void(* HandlerType )(int)

Enumerations

enum  CrashFlag { KeepFDs = 1, SaferDialog = 2, AlwaysDirectly = 4, AutoRestart = 8 }

Functions

KCrash::HandlerType crashHandler ()
void defaultCrashHandler (int signal)
KCrash::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 setFlags (KCrash::CrashFlags flags)
void startDirectly (const char *argv[], int argc)
void startDrKonqi (const char *argv[], int argc)

Typedef Documentation

typedef void(* KCrash::HandlerType)(int)

This function type is a pointer to a crash handler function.

The function's argument is the number of the signal.

Definition at line 50 of file kcrash.h.


Enumeration Type Documentation

enum KCrash::CrashFlag

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

Enumerator:
KeepFDs  don't close all file descriptors immediately
SaferDialog  start DrKonqi without arbitrary disk access
AlwaysDirectly  never try to to start DrKonqi via kdeinit
AutoRestart  autorestart this application. Only sensible for KUniqueApplications.

Since:
4.1.

Definition at line 89 of file kcrash.h.


Function Documentation

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.

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::setFlags ( KCrash::CrashFlags  flags  ) 

Definition at line 127 of file kcrash.cpp.

void KCrash::startDirectly ( const char *  argv[],
int  argc 
)

Definition at line 415 of file kcrash.cpp.

void KCrash::startDrKonqi ( const char *  argv[],
int  argc 
)

Definition at line 360 of file kcrash.cpp.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal