diff options
Diffstat (limited to 'src/crashhandler.cpp')
-rw-r--r-- | src/crashhandler.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/crashhandler.cpp b/src/crashhandler.cpp index 5e072e6..7505f6a 100644 --- a/src/crashhandler.cpp +++ b/src/crashhandler.cpp @@ -20,10 +20,10 @@ #include <klocale.h> #include <ktempfile.h> -#include <qfile.h> -#include <qregexp.h> -#include <qtextstream.h> -#include <qglobal.h> //qVersion() +#include <ntqfile.h> +#include <ntqregexp.h> +#include <ntqtextstream.h> +#include <ntqglobal.h> //tqVersion() #include <cstdio> //popen, fread #include <iostream> @@ -44,8 +44,8 @@ namespace torK }; #endif - static QString - runCommand( const QCString &command ) + static TQString + runCommand( const TQCString &command ) { static const uint SIZE = 40960; //40 KiB static char stdoutBuf[ SIZE ] = {0}; @@ -58,7 +58,7 @@ namespace torK stdoutBuf[ std::fread( static_cast<void*>( stdoutBuf ), sizeof(char), SIZE-1, process ) ] = '\0'; ::pclose( process ); } - return QString::fromLocal8Bit( stdoutBuf ); + return TQString::fromLocal8Bit( stdoutBuf ); } void @@ -79,8 +79,8 @@ namespace torK // we are the child process (the result of the fork) std::cout << "TorK is crashing...\n"; - QString subject = TORK_VERSION " "; - QString body = i18n( + TQString subject = TORK_VERSION " "; + TQString body = i18n( "TorK has crashed! We are terribly sorry about this :(\n\n" "But, all is not lost! You could potentially help us fix the crash. " "Information describing the crash is below, so just click send, " @@ -96,14 +96,14 @@ namespace torK "Build date: " __DATE__ "\n" "CC version: " __VERSION__ "\n" //assuming we're using GCC "KDElibs: " KDE_VERSION_STRING "\n" - "Qt: %2\n" + "TQt: %2\n" "CPU count: %6\n"; - QString cpucount = "unknown"; + TQString cpucount = "unknown"; #ifdef __linux__ - QString line; + TQString line; uint cpuCount = 0; - QFile cpuinfo( "/proc/cpuinfo" ); + TQFile cpuinfo( "/proc/cpuinfo" ); if ( cpuinfo.open( IO_ReadOnly ) ) { while ( cpuinfo.readLine( line, 20000 ) != -1 ) { if ( line.startsWith( "processor" ) ) { @@ -111,11 +111,11 @@ namespace torK } } } - cpucount = QString::number( cpuCount ); + cpucount = TQString::number( cpuCount ); #endif - body = body.arg( qVersion() ) + body = body.arg( tqVersion() ) .arg( cpucount ); #ifdef NDEBUG @@ -130,13 +130,13 @@ namespace torK const int handle = temp.handle(); -// QCString gdb_command_string = +// TQCString gdb_command_string = // "file tork\n" -// "attach " + QCString().setNum( ::getppid() ) + "\n" +// "attach " + TQCString().setNum( ::getppid() ) + "\n" // "bt\n" "echo \\n\n" // "thread apply all bt\n"; - const QCString gdb_batch = + const TQCString gdb_batch = "bt\n" "echo \\n\\n\n" "bt full\n" @@ -151,23 +151,23 @@ namespace torK ::dup2( fileno( stdout ), fileno( stderr ) ); - QCString gdb; + TQCString gdb; gdb = "gdb --nw -n --batch -x "; gdb += temp.name().latin1(); gdb += " tork "; - gdb += QCString().setNum( ::getppid() ); + gdb += TQCString().setNum( ::getppid() ); - QString bt = runCommand( gdb ); + TQString bt = runCommand( gdb ); /// clean up bt.remove( "(no debugging symbols found)..." ); bt.remove( "(no debugging symbols found)\n" ); - bt.replace( QRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters + bt.replace( TQRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters bt.stripWhiteSpace(); /// analyze usefulness bool useful = true; - const QString fileCommandOutput = runCommand( "file `which tork`" ); + const TQString fileCommandOutput = runCommand( "file `which tork`" ); if( fileCommandOutput.find( "not stripped", false ) == -1 ) subject += "[___stripped]"; //same length as below @@ -175,18 +175,18 @@ namespace torK subject += "[NOTstripped]"; if( !bt.isEmpty() ) { - const int invalidFrames = bt.contains( QRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") ); - const int validFrames = bt.contains( QRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") ); + const int invalidFrames = bt.contains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") ); + const int validFrames = bt.contains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") ); const int totalFrames = invalidFrames + validFrames; if( totalFrames > 0 ) { const double validity = double(validFrames) / totalFrames; - subject += QString("[validity: %1]").arg( validity, 0, 'f', 2 ); + subject += TQString("[validity: %1]").arg( validity, 0, 'f', 2 ); if( validity <= 0.5 ) useful = false; } - subject += QString("[frames: %1]").arg( totalFrames, 3 /*padding*/ ); + subject += TQString("[frames: %1]").arg( totalFrames, 3 /*padding*/ ); - if( bt.find( QRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 ) + if( bt.find( TQRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 ) subject += "[line numbers]"; } else @@ -211,12 +211,12 @@ namespace torK //TODO startup notification kapp->invokeMailer( /*to*/ "tork-backtraces@lists.sf.net", - /*cc*/ QString(), - /*bcc*/ QString(), + /*cc*/ TQString(), + /*bcc*/ TQString(), /*subject*/ subject, /*body*/ body, - /*messageFile*/ QString(), - /*attachURLs*/ QStringList(), + /*messageFile*/ TQString(), + /*attachURLs*/ TQStringList(), /*startup_id*/ "" ); } else { @@ -245,9 +245,9 @@ namespace torK #if 0 -#include <qlabel.h> -#include <qlayout.h> -#include <qvbox.h> +#include <ntqlabel.h> +#include <ntqlayout.h> +#include <ntqvbox.h> #include <kdialog.h> #include <kpushbutton.h> #include <kstdguiitem.h> @@ -255,20 +255,20 @@ namespace torK torK::CrashHandlerWidget::CrashHandlerWidget() { - QBoxLayout *layout = new QHBoxLayout( this, 18, 12 ); + TQBoxLayout *layout = new TQHBoxLayout( this, 18, 12 ); { - QBoxLayout *lay = new QVBoxLayout( layout ); - QLabel *label = new QLabel( this ); + TQBoxLayout *lay = new TQVBoxLayout( layout ); + TQLabel *label = new TQLabel( this ); label->setPixmap( locate( "data", "drkonqi/pics/konqi.png" ) ); - label->setFrameStyle( QFrame::Plain | QFrame::Box ); + label->setFrameStyle( TQFrame::Plain | TQFrame::Box ); lay->add( label ); - lay->addItem( new QSpacerItem( 3, 3, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + lay->addItem( new TQSpacerItem( 3, 3, TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); } - layout = new QVBoxLayout( layout, 6 ); + layout = new TQVBoxLayout( layout, 6 ); - layout->add( new QLabel( /*i18n*/( + layout->add( new TQLabel( /*i18n*/( "<p>" "TorK has crashed! We are terribly sorry about this :(" "<p>" "However you now have an opportunity to help us fix this crash so that it doesn't " "happen again! Click <b>Send Email</b> and TorK will prepare an email that you " @@ -276,13 +276,13 @@ torK::CrashHandlerWidget::CrashHandlerWidget() "as soon as possible." "<p>" "Thanks for choosing TorK.<br>" ), this ) ); - layout = new QHBoxLayout( layout, 6 ); + layout = new TQHBoxLayout( layout, 6 ); - layout->addItem( new QSpacerItem( 6, 6, QSizePolicy::Expanding ) ); + layout->addItem( new TQSpacerItem( 6, 6, TQSizePolicy::Expanding ) ); layout->add( new KPushButton( KGuiItem( i18n("Send Email"), "mail_send" ), this, "email" ) ); layout->add( new KPushButton( KStdGuiItem::close(), this, "close" ) ); - static_cast<QPushButton*>(child("email"))->setDefault( true ); + static_cast<TQPushButton*>(child("email"))->setDefault( true ); connect( child( "email" ), SIGNAL(clicked()), SLOT(accept()) ); connect( child( "close" ), SIGNAL(clicked()), SLOT(reject()) ); |