\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)
\begin{CompactList}\small\item\em This function type is a pointer to a crash handler function. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf default\-Crash\-Handler} (int signal)
\begin{CompactList}\small\item\em The default crash handler. \item\end{CompactList}\item 
void {\bf set\-Crash\-Handler} ({\bf Handler\-Type} handler=default\-Crash\-Handler)
\begin{CompactList}\small\item\em Install a function to be called in case a SIGSEGV is caught. \item\end{CompactList}\item 
{\bf Handler\-Type} {\bf crash\-Handler} ()
\begin{CompactList}\small\item\em Returns the installed crash handler. \item\end{CompactList}\item 
void {\bf set\-Emergency\-Save\-Function} ({\bf Handler\-Type} save\-Function=({\bf Handler\-Type}) 0)
\begin{CompactList}\small\item\em Installs a function which should try to save the applications data. \item\end{CompactList}\item 
{\bf Handler\-Type} {\bf emergency\-Save\-Function} ()
\begin{CompactList}\small\item\em Return the currently set emergency save function. \item\end{CompactList}\item 
void {\bf set\-Application\-Path} ({\bf QString} path)
\begin{CompactList}\small\item\em Sets the application {\tt path} which should be passed to Dr. \item\end{CompactList}\item 
void {\bf set\-Application\-Name} ({\bf QString} name)
\begin{CompactList}\small\item\em Sets the application name {\tt name} which should be passed to Dr. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Protected Attributes}
\begin{CompactItemize}
\item 
{\bf Handler\-Type} {\bf \_\-crash\-Handler} = 0
\begin{CompactList}\small\item\em Pointer to the crash handler. \item\end{CompactList}\item 
{\bf Handler\-Type} {\bf \_\-emergency\-Save\-Function} = 0
\begin{CompactList}\small\item\em Pointer to the emergency save function. \item\end{CompactList}\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 36 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 53 of file kcrash.h.

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

\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 108 of file kcrash.cpp.

References \_\-emergency\-Save\-Function, KInstance::about\-Data(), KAbout\-Data::bug\-Address(), KStd\-Action::close(), DCOPClient::emergency\-Close(), KNotify\-Client::instance(), 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} = default\-Crash\-Handler)\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\-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 77 of file kcrash.cpp.

References \_\-crash\-Handler, and Handler\-Type.\index{KCrash@{KCrash}!crashHandler@{crashHandler}}
\index{crashHandler@{crashHandler}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\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 72 of file kcrash.h.

References \_\-crash\-Handler, and Handler\-Type.\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} = ({\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 61 of file kcrash.cpp.

References \_\-crash\-Handler, \_\-emergency\-Save\-Function, default\-Crash\-Handler(), and Handler\-Type.\index{KCrash@{KCrash}!emergencySaveFunction@{emergencySaveFunction}}
\index{emergencySaveFunction@{emergencySaveFunction}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\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 86 of file kcrash.h.

References \_\-emergency\-Save\-Function, and Handler\-Type.\index{KCrash@{KCrash}!setApplicationPath@{setApplicationPath}}
\index{setApplicationPath@{setApplicationPath}!KCrash@{KCrash}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCrash::set\-Application\-Path ({\bf QString} {\em path})\hspace{0.3cm}{\tt  [inline, static]}}\label{classKCrash_e5}


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 93 of file kcrash.h.

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


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 100 of file kcrash.h.

References KStd\-Action::name().

\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 53 of file kcrash.cpp.

Referenced by crash\-Handler(), 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 52 of file kcrash.cpp.

Referenced by default\-Crash\-Handler(), emergency\-Save\-Function(), 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}
