void TWebApplication::timerEvent(QTimerEvent *event) { if (event->timerId() == timer.timerId()) { if (signalNumber() >= 0) { tSystemDebug("TWebApplication trapped signal number:%d", signalNumber()); //timer.stop(); /* Don't stop this timer */ exit(signalNumber()); } } else { #ifdef TF_USE_GUI_MODULE QApplication::timerEvent(event); #else QCoreApplication::timerEvent(event); #endif } }
// replace some of the strings void KrashConfig :: expandString(QString &str, bool shell, const QString &tempFile) const { QMap<QString,QString> map; map[QString::fromLatin1("appname")] = QString::fromLatin1(appName()); map[QString::fromLatin1("execname")] = startedByKdeinit() ? QString::fromLatin1("kdeinit") : m_execname; map[QString::fromLatin1("signum")] = QString::number(signalNumber()); map[QString::fromLatin1("signame")] = signalName(); map[QString::fromLatin1("progname")] = programName(); map[QString::fromLatin1("pid")] = QString::number(pid()); map[QString::fromLatin1("tempfile")] = tempFile; if (shell) str = KMacroExpander::expandMacrosShellQuote( str, map ); else str = KMacroExpander::expandMacros( str, map ); }
/* This method is static to this file and shouldn't be used directly. it just does the actual work for findSoftKillSig() and findRmKillSig(). In here, we lookup the given attribute name, which specifies a signal we want to use. The signal could either be stored as an int, or as a string. if it's a string, we want to translate it into the appropriate signal number for this platform. */ static int findSignal( ClassAd* ad, const char* attr_name ) { if( ! ad ) { return -1; } MyString name; int signal; if ( ad->LookupInteger( attr_name, signal ) ) { return signal; } else if ( ad->LookupString( attr_name, name ) ) { return signalNumber( name.Value() ); } else { return -1; } }