\section{KCrash Class Reference}
\label{classKCrash}\index{KCrash@{KCrash}}
This class handles segmentation-faults.  


{\tt \#include $<$kcrash.h$>$}

\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef void($\ast$ {\bf Handler\-Type} )(int)
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static void {\bf default\-Crash\-Handler} (int signal)
\item 
static void {\bf set\-Crash\-Handler} ({\bf Handler\-Type} handler=default\-Crash\-Handler)
\item 
static {\bf Handler\-Type} {\bf crash\-Handler} ()
\item 
static void {\bf set\-Emergency\-Save\-Function} ({\bf Handler\-Type} save\-Function=({\bf Handler\-Type}) 0)
\item 
static {\bf Handler\-Type} {\bf emergency\-Save\-Function} ()
\item 
static void {\bf set\-Safer} (bool on)
\item 
static void {\bf set\-Application\-Path} ({\bf QString} path)
\item 
static void {\bf set\-Application\-Name} ({\bf QString} name)
\end{CompactItemize}
\subsection*{Static Protected Attributes}
\begin{CompactItemize}
\item 
static {\bf Handler\-Type} {\bf \_\-crash\-Handler} = 0
\item 
static {\bf Handler\-Type} {\bf \_\-emergency\-Save\-Function} = 0
\end{CompactItemize}


\subsection{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 {\bf set\-Crash\-Handler()}{\rm (p.\,\pageref{classKCrash_e1})}. If a function is specified with {\bf set\-Emergency\-Save\-Function()}{\rm (p.\,\pageref{classKCrash_e3})} it will be called by the default crash handler, giving the application a chance to save its data. 



Definition at line 37 of file kcrash.h.

\subsection{Member Typedef Documentation}
\index{KCrash@{KCrash}!HandlerType@{HandlerType}}
\index{HandlerType@{HandlerType}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ {\bf KCrash::Handler\-Type})(int)}\label{classKCrash_w0}


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

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

Definition at line 55 of file kcrash.h.

\subsection{Member Function Documentation}
\index{KCrash@{KCrash}!defaultCrashHandler@{defaultCrashHandler}}
\index{defaultCrashHandler@{defaultCrashHandler}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCrash::default\-Crash\-Handler (int {\em signal})\hspace{0.3cm}{\tt  [static]}}\label{classKCrash_e0}


The default crash handler. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]the signal number \end{description}
\end{Desc}


Definition at line 113 of file kcrash.cpp.

References \_\-emergency\-Save\-Function, KInstance::about\-Data(), KAbout\-Data::bug\-Address(), DCOPClient::emergency\-Close(), QString::is\-Null(), KAbout\-Data::program\-Name(), QCString::set\-Num(), QString::utf8(), and KAbout\-Data::version().

Referenced by set\-Emergency\-Save\-Function().\index{KCrash@{KCrash}!setCrashHandler@{setCrashHandler}}
\index{setCrashHandler@{setCrashHandler}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCrash::set\-Crash\-Handler ({\bf Handler\-Type} {\em handler} = {\tt defaultCrashHandler})\hspace{0.3cm}{\tt  [static]}}\label{classKCrash_e1}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handler}]Handler\-Type handler can be one of \begin{itemize}
\item null in which case signal-catching is disabled (by calling signal(SIGSEGV, SIG\_\-DFL)) \item if handler is omitted the default crash handler is installed. \item an user defined function in the form: static (if in a class) void my\-Crash\-Handler(int); \end{itemize}
\item[{\em handler}]the crash handler \end{description}
\end{Desc}


Definition at line 80 of file kcrash.cpp.

References \_\-crash\-Handler.\index{KCrash@{KCrash}!crashHandler@{crashHandler}}
\index{crashHandler@{crashHandler}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static {\bf Handler\-Type} KCrash::crash\-Handler ()\hspace{0.3cm}{\tt  [inline, static]}}\label{classKCrash_e2}


Returns the installed crash handler. 

\begin{Desc}
\item[Returns:]the crash handler \end{Desc}


Definition at line 74 of file kcrash.h.\index{KCrash@{KCrash}!setEmergencySaveFunction@{setEmergencySaveFunction}}
\index{setEmergencySaveFunction@{setEmergencySaveFunction}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCrash::set\-Emergency\-Save\-Function ({\bf Handler\-Type} {\em save\-Function} = {\tt ({\bf Handler\-Type})~0})\hspace{0.3cm}{\tt  [static]}}\label{classKCrash_e3}


Installs a function which should try to save the applications data. 

It is the crash handler180s 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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em save\-Function}]the handler to install \end{description}
\end{Desc}


Definition at line 64 of file kcrash.cpp.

References \_\-crash\-Handler, \_\-emergency\-Save\-Function, and default\-Crash\-Handler().\index{KCrash@{KCrash}!emergencySaveFunction@{emergencySaveFunction}}
\index{emergencySaveFunction@{emergencySaveFunction}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static {\bf Handler\-Type} KCrash::emergency\-Save\-Function ()\hspace{0.3cm}{\tt  [inline, static]}}\label{classKCrash_e4}


Return the currently set emergency save function. 

\begin{Desc}
\item[Returns:]the emergency save function \end{Desc}


Definition at line 88 of file kcrash.h.\index{KCrash@{KCrash}!setSafer@{setSafer}}
\index{setSafer@{setSafer}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void KCrash::set\-Safer (bool {\em on})\hspace{0.3cm}{\tt  [inline, static]}}\label{classKCrash_e5}


Set whether to start drkonqi without arbitrary disk access. 



Definition at line 93 of file kcrash.h.\index{KCrash@{KCrash}!setApplicationPath@{setApplicationPath}}
\index{setApplicationPath@{setApplicationPath}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void KCrash::set\-Application\-Path ({\bf QString} {\em path})\hspace{0.3cm}{\tt  [inline, static]}}\label{classKCrash_e6}


Sets the application {\tt path} which should be passed to Dr. 

Konqi, our nice crash display application. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em path}]the application path. \end{description}
\end{Desc}


Definition at line 100 of file kcrash.h.

References QString::local8Bit().\index{KCrash@{KCrash}!setApplicationName@{setApplicationName}}
\index{setApplicationName@{setApplicationName}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void KCrash::set\-Application\-Name ({\bf QString} {\em name})\hspace{0.3cm}{\tt  [inline, static]}}\label{classKCrash_e7}


Sets the application name {\tt name} which should be passed to Dr. 

Konqi, our nice crash display application. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]the name of the application, as shown in Dr. Konqi \end{description}
\end{Desc}


Definition at line 108 of file kcrash.h.

References QString::local8Bit().

\subsection{Member Data Documentation}
\index{KCrash@{KCrash}!_crashHandler@{\_\-crashHandler}}
\index{_crashHandler@{\_\-crashHandler}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KCrash::Handler\-Type} {\bf KCrash::\_\-crash\-Handler} = 0\hspace{0.3cm}{\tt  [static, protected]}}\label{classKCrash_t0}


Pointer to the crash handler. 



Definition at line 55 of file kcrash.cpp.

Referenced by set\-Crash\-Handler(), and set\-Emergency\-Save\-Function().\index{KCrash@{KCrash}!_emergencySaveFunction@{\_\-emergencySaveFunction}}
\index{_emergencySaveFunction@{\_\-emergencySaveFunction}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KCrash::Handler\-Type} {\bf KCrash::\_\-emergency\-Save\-Function} = 0\hspace{0.3cm}{\tt  [static, protected]}}\label{classKCrash_t1}


Pointer to the emergency save function. 



Definition at line 54 of file kcrash.cpp.

Referenced by default\-Crash\-Handler(), and set\-Emergency\-Save\-Function().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kcrash.h\item 
kcrash.cpp\end{CompactItemize}
