kcrash.h
/*
* This file is part of the KDE Libraries
* Copyright (C) 2000 Timo Hummel <timo.hummel@sap.com>
* Tom Braun <braunt@fh-konstanz.de>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef __KCRASH_H
#define __KCRASH_H
#include <qstring.h>
#include "kdelibs_export.h"
class KDECORE_EXPORT KCrash
{
private: // ;o)
static const char *appName;
static const char *appPath;
static bool safer;
public:
static void defaultCrashHandler (int signal);
typedef void (*HandlerType)(int);
static void setCrashHandler (HandlerType handler = defaultCrashHandler);
static HandlerType crashHandler() { return _crashHandler; }
static void setEmergencySaveFunction (HandlerType saveFunction = (HandlerType)0);
static HandlerType emergencySaveFunction() { return _emergencySaveFunction; }
static void setSafer( bool on ) { safer = on; }
static void setApplicationPath (QString path) { appPath = qstrdup(path.local8Bit().data()); }
/* KDE 4: Make it const QString & */
static void setApplicationName (QString name) { appName = qstrdup(name.local8Bit().data()); }
/* KDE 4: Make it const QString & */
protected:
static HandlerType _crashHandler;
static HandlerType _emergencySaveFunction;
private:
static void startDrKonqi( const char* argv[], int argc );
static void startDirectly( const char* argv[], int argc );
};
#endif
KCrash
This class handles segmentation-faults.
Definition: kcrash.h:37
KCrash::setApplicationName
static void setApplicationName(QString name)
Sets the application name name which should be passed to Dr.
Definition: kcrash.h:108
KCrash::setApplicationPath
static void setApplicationPath(QString path)
Sets the application path which should be passed to Dr.
Definition: kcrash.h:100
KCrash::crashHandler
static HandlerType crashHandler()
Returns the installed crash handler.
Definition: kcrash.h:74
KCrash::_crashHandler
static HandlerType _crashHandler
Pointer to the crash handler.
Definition: kcrash.h:115
KCrash::setSafer
static void setSafer(bool on)
Set whether to start drkonqi without arbitrary disk access.
Definition: kcrash.h:93
KCrash::_emergencySaveFunction
static HandlerType _emergencySaveFunction
Pointer to the emergency save function.
Definition: kcrash.h:119
KCrash::emergencySaveFunction
static HandlerType emergencySaveFunction()
Return the currently set emergency save function.
Definition: kcrash.h:88

KDE Home | KDE Accessibility Home | Description of Access Keys