Rename KCrash to avoid conflicts with KDE4

pull/16/head
Timothy Pearson 12 years ago
parent a07501e296
commit 4b3606f910

@ -21,7 +21,7 @@ v1.0:
<IncludeRules context="oneliners" />
</context>
<context name="oneliners" attribute="Normal" lineEndContext="#pop">
<StringDetect attribute="Crash" context="#stay" String="[KCrash Handler]" />
<StringDetect attribute="Crash" context="#stay" String="[TDECrash Handler]" />
<StringDetect String="Thread" firstNonSpace="true" context="thread" />
<StringDetect String="[Current thread" firstNonSpace="true" context="thread" />
</context>

@ -450,7 +450,7 @@ tqWarning("Last DCOP call before KDED crash was from application '%s'\n"
void Kded::installCrashHandler()
{
KCrash::setEmergencySaveFunction(crashHandler);
TDECrash::setEmergencySaveFunction(crashHandler);
}
void Kded::recreate()

@ -759,9 +759,9 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
}
#endif
KCrash::setCrashHandler(KCrash::defaultCrashHandler);
KCrash::setEmergencySaveFunction(crashHandler);
KCrash::setApplicationName(TQString(appName));
TDECrash::setCrashHandler(TDECrash::defaultCrashHandler);
TDECrash::setEmergencySaveFunction(crashHandler);
TDECrash::setApplicationName(TQString(appName));
// this program is in tdelibs so it uses tdelibs as catalog
TDELocale::setMainCatalogue("tdelibs");

@ -105,7 +105,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv )
launcher->dcopClient()->setDefaultObject( name );
launcher->dcopClient()->setDaemonMode( true );
KCrash::setEmergencySaveFunction(sig_handler);
TDECrash::setEmergencySaveFunction(sig_handler);
signal( SIGHUP, sig_handler);
signal( SIGPIPE, SIG_IGN);
signal( SIGTERM, sig_handler);

@ -100,7 +100,7 @@ KDE_EXPORT int main(int argc, char *argv[])
TDEApplication app;
KCrash::setCrashHandler( crashHandler );
TDECrash::setCrashHandler( crashHandler );
TDEGlobal::locale()->insertCatalogue("klock");
TDEGlobal::locale()->insertCatalogue("tdescreensaver");

@ -266,7 +266,7 @@ TDEAboutData::internalProgramName() const
return mProgramName;
}
// KCrash should call as few things as possible and should avoid e.g. malloc()
// TDECrash should call as few things as possible and should avoid e.g. malloc()
// because it may deadlock. Since i18n() needs it, when TDELocale is available
// the i18n() call will be done here in advance.
void

@ -1646,10 +1646,10 @@ void TDEApplication::parseCommandLine( )
if (!nocrashhandler && args->isSet("crashhandler"))
{
// set default crash handler / set emergency save function to nothing
KCrash::setCrashHandler(KCrash::defaultCrashHandler);
KCrash::setEmergencySaveFunction(NULL);
TDECrash::setCrashHandler(TDECrash::defaultCrashHandler);
TDECrash::setEmergencySaveFunction(NULL);
KCrash::setApplicationName(TQString(args->appName()));
TDECrash::setApplicationName(TQString(args->appName()));
}
#ifdef Q_WS_X11

@ -57,17 +57,17 @@
#include <X11/Xlib.h>
#endif
KCrash::HandlerType KCrash::_emergencySaveFunction = 0;
KCrash::HandlerType KCrash::_crashHandler = 0;
const char *KCrash::appName = 0;
const char *KCrash::appPath = 0;
bool KCrash::safer = false;
TDECrash::HandlerType TDECrash::_emergencySaveFunction = 0;
TDECrash::HandlerType TDECrash::_crashHandler = 0;
const char *TDECrash::appName = 0;
const char *TDECrash::appPath = 0;
bool TDECrash::safer = false;
// This function sets the function which should be called when the
// application crashes and the
// application is asked to try to save its data.
void
KCrash::setEmergencySaveFunction (HandlerType saveFunction)
TDECrash::setEmergencySaveFunction (HandlerType saveFunction)
{
_emergencySaveFunction = saveFunction;
@ -83,7 +83,7 @@ KCrash::setEmergencySaveFunction (HandlerType saveFunction)
// This function sets the function which should be responsible for
// the application crash handling.
void
KCrash::setCrashHandler (HandlerType handler)
TDECrash::setCrashHandler (HandlerType handler)
{
#ifdef Q_OS_UNIX
if (!handler)
@ -116,7 +116,7 @@ KCrash::setCrashHandler (HandlerType handler)
}
void
KCrash::defaultCrashHandler (int sig)
TDECrash::defaultCrashHandler (int sig)
{
#ifdef Q_OS_UNIX
// WABA: Do NOT use kdDebug() in this function because it is much too risky!
@ -148,10 +148,10 @@ KCrash::defaultCrashHandler (int sig)
if (appName)
{
#ifndef NDEBUG
fprintf(stderr, "[kcrash] KCrash: crashing... crashRecursionCounter = %d\n", crashRecursionCounter);
fprintf(stderr, "[kcrash] KCrash: Application Name = %s path = %s pid = %d\n", appName ? appName : "<unknown>" , appPath ? appPath : "<unknown>", getpid());
fprintf(stderr, "[kcrash] TDECrash: crashing... crashRecursionCounter = %d\n", crashRecursionCounter);
fprintf(stderr, "[kcrash] TDECrash: Application Name = %s path = %s pid = %d\n", appName ? appName : "<unknown>" , appPath ? appPath : "<unknown>", getpid());
#else
fprintf(stderr, "[kcrash] KCrash: Application '%s' crashing...\n", appName ? appName : "<unknown>");
fprintf(stderr, "[kcrash] TDECrash: Application '%s' crashing...\n", appName ? appName : "<unknown>");
#endif
const char * argv[24]; // don't forget to update this
@ -254,7 +254,7 @@ static int write_socket(int sock, char *buffer, int len);
static int read_socket(int sock, char *buffer, int len);
static int openSocket();
void KCrash::startDrKonqi( const char* argv[], int argc )
void TDECrash::startDrKonqi( const char* argv[], int argc )
{
int socket = openSocket();
if( socket < -1 )
@ -277,7 +277,7 @@ void KCrash::startDrKonqi( const char* argv[], int argc )
int len = strlen( argv[ i ] ) + 1; // include terminating \0
if( pos + len > BUFSIZE )
{
fprintf( stderr, "[kcrash] BUFSIZE in KCrash not big enough!\n" );
fprintf( stderr, "[kcrash] BUFSIZE in TDECrash not big enough!\n" );
startDirectly( argv, argc );
return;
}
@ -315,9 +315,9 @@ void KCrash::startDrKonqi( const char* argv[], int argc )
}
// If we can't reach tdeinit we can still at least try to fork()
void KCrash::startDirectly( const char* argv[], int )
void TDECrash::startDirectly( const char* argv[], int )
{
fprintf( stderr, "[kcrash] KCrash cannot reach tdeinit, launching directly.\n" );
fprintf( stderr, "[kcrash] TDECrash cannot reach tdeinit, launching directly.\n" );
pid_t pid = fork();
if (pid <= 0)
{

@ -34,7 +34,7 @@
* be called by the default crash handler, giving the application a chance
* to save its data.
*/
class TDECORE_EXPORT KCrash
class TDECORE_EXPORT TDECrash
{
private: // ;o)
static const char *appName;

@ -40,12 +40,12 @@
typedef TQMap<TQString, TQString> ViewMap;
// KDE 4.0: remove this BC keeping stub
void KCrashBookmarkImporter::parseCrashLog( TQString /*filename*/, bool /*del*/ )
void TDECrashBookmarkImporter::parseCrashLog( TQString /*filename*/, bool /*del*/ )
{
;
}
ViewMap KCrashBookmarkImporterImpl::parseCrashLog_noemit( const TQString & filename, bool del )
ViewMap TDECrashBookmarkImporterImpl::parseCrashLog_noemit( const TQString & filename, bool del )
{
static const int g_lineLimit = 16*1024;
@ -88,12 +88,12 @@ ViewMap KCrashBookmarkImporterImpl::parseCrashLog_noemit( const TQString & filen
return views;
}
TQStringList KCrashBookmarkImporter::getCrashLogs()
TQStringList TDECrashBookmarkImporter::getCrashLogs()
{
return KCrashBookmarkImporterImpl::getCrashLogs();
return TDECrashBookmarkImporterImpl::getCrashLogs();
}
TQStringList KCrashBookmarkImporterImpl::getCrashLogs()
TQStringList TDECrashBookmarkImporterImpl::getCrashLogs()
{
TQMap<TQString, bool> activeLogs;
@ -127,7 +127,7 @@ TQStringList KCrashBookmarkImporterImpl::getCrashLogs()
activeLogs[ret] = true;
}
TQDir d( KCrashBookmarkImporterImpl().findDefaultLocation() );
TQDir d( TDECrashBookmarkImporterImpl().findDefaultLocation() );
d.setSorting( TQDir::Time );
d.setFilter( TQDir::Files );
d.setNameFilter( "konqueror-crash-*.log" );
@ -154,10 +154,10 @@ TQStringList KCrashBookmarkImporterImpl::getCrashLogs()
return crashFiles;
}
void KCrashBookmarkImporterImpl::parse()
void TDECrashBookmarkImporterImpl::parse()
{
TQDict<bool> signatureMap;
TQStringList crashFiles = KCrashBookmarkImporterImpl::getCrashLogs();
TQStringList crashFiles = TDECrashBookmarkImporterImpl::getCrashLogs();
int count = 1;
for ( TQStringList::Iterator it = crashFiles.begin(); it != crashFiles.end(); ++it )
{
@ -185,29 +185,29 @@ void KCrashBookmarkImporterImpl::parse()
}
}
TQString KCrashBookmarkImporter::crashBookmarksDir()
TQString TDECrashBookmarkImporter::crashBookmarksDir()
{
static KCrashBookmarkImporterImpl *p = 0;
static TDECrashBookmarkImporterImpl *p = 0;
if (!p)
p = new KCrashBookmarkImporterImpl;
p = new TDECrashBookmarkImporterImpl;
return p->findDefaultLocation();
}
void KCrashBookmarkImporterImpl::setShouldDelete( bool shouldDelete )
void TDECrashBookmarkImporterImpl::setShouldDelete( bool shouldDelete )
{
m_shouldDelete = shouldDelete;
}
void KCrashBookmarkImporter::parseCrashBookmarks( bool del )
void TDECrashBookmarkImporter::parseCrashBookmarks( bool del )
{
KCrashBookmarkImporterImpl importer;
TDECrashBookmarkImporterImpl importer;
importer.setFilename( m_fileName );
importer.setShouldDelete( del );
importer.setupSignalForwards( &importer, this );
importer.parse();
}
TQString KCrashBookmarkImporterImpl::findDefaultLocation( bool ) const
TQString TDECrashBookmarkImporterImpl::findDefaultLocation( bool ) const
{
return locateLocal( "tmp", "" );
}

@ -34,12 +34,12 @@
* A class for importing all crash sessions as bookmarks
* @deprecated
*/
class TDEIO_EXPORT_DEPRECATED KCrashBookmarkImporter : public TQObject
class TDEIO_EXPORT_DEPRECATED TDECrashBookmarkImporter : public TQObject
{
Q_OBJECT
public:
KCrashBookmarkImporter( const TQString & fileName ) : m_fileName(fileName) {}
~KCrashBookmarkImporter() {}
TDECrashBookmarkImporter( const TQString & fileName ) : m_fileName(fileName) {}
~TDECrashBookmarkImporter() {}
void parseCrashBookmarks( bool del = true );
static TQString crashBookmarksDir( );
static TQStringList getCrashLogs(); // EMPTY!
@ -57,10 +57,10 @@ protected:
* A class for importing all crash sessions as bookmarks
* @since 3.2
*/
class TDEIO_EXPORT KCrashBookmarkImporterImpl : public KBookmarkImporterBase
class TDEIO_EXPORT TDECrashBookmarkImporterImpl : public KBookmarkImporterBase
{
public:
KCrashBookmarkImporterImpl() : m_shouldDelete(false) { }
TDECrashBookmarkImporterImpl() : m_shouldDelete(false) { }
void setShouldDelete(bool);
virtual void parse();
virtual TQString findDefaultLocation(bool forSaving = false) const;
@ -68,7 +68,7 @@ public:
private:
bool m_shouldDelete;
TQMap<TQString, TQString> parseCrashLog_noemit( const TQString & filename, bool del );
class KCrashBookmarkImporterImplPrivate *d;
class TDECrashBookmarkImporterImplPrivate *d;
};
#endif

@ -170,7 +170,7 @@ SlaveBase::SlaveBase( const TQCString &protocol,
#ifdef Q_OS_UNIX
if (!getenv("TDE_DEBUG"))
{
KCrash::setCrashHandler( sigsegv_handler );
TDECrash::setCrashHandler( sigsegv_handler );
signal(SIGILL,&sigsegv_handler);
signal(SIGTRAP,&sigsegv_handler);
signal(SIGABRT,&sigsegv_handler);

Loading…
Cancel
Save