diff options
Diffstat (limited to 'amarok/src/amarokcore/crashhandler.cpp')
-rw-r--r-- | amarok/src/amarokcore/crashhandler.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/amarok/src/amarokcore/crashhandler.cpp b/amarok/src/amarokcore/crashhandler.cpp index 3711b63c..c0185b4f 100644 --- a/amarok/src/amarokcore/crashhandler.cpp +++ b/amarok/src/amarokcore/crashhandler.cpp @@ -18,10 +18,10 @@ #include <klocale.h> #include <ktempfile.h> -#include <qfile.h> -#include <qregexp.h> -#include <qtextstream.h> -#include <qglobal.h> //qVersion() +#include <tqfile.h> +#include <tqregexp.h> +#include <tqtextstream.h> +#include <tqglobal.h> //qVersion() #include <cstdio> //popen, fread #include <iostream> @@ -48,7 +48,7 @@ namespace Amarok #endif static QString - runCommand( const QCString &command ) + runCommand( const TQCString &command ) { static const uint SIZE = 40960; //40 KiB static char stdoutBuf[ SIZE ] = {0}; @@ -61,7 +61,7 @@ namespace Amarok stdoutBuf[ std::fread( static_cast<void*>( stdoutBuf ), sizeof(char), SIZE-1, process ) ] = '\0'; ::pclose( process ); } - return QString::fromLocal8Bit( stdoutBuf ); + return TQString::fromLocal8Bit( stdoutBuf ); } void @@ -82,8 +82,8 @@ namespace Amarok // we are the child process (the result of the fork) std::cout << "Amarok is crashing...\n"; - QString subject = APP_VERSION " "; - QString body = i18n( + TQString subject = APP_VERSION " "; + TQString body = i18n( "Amarok 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, " @@ -104,11 +104,11 @@ namespace Amarok "TagLib: %3.%4.%5\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" ) ) { @@ -116,7 +116,7 @@ namespace Amarok } } } - cpucount = QString::number( cpuCount ); + cpucount = TQString::number( cpuCount ); #endif @@ -139,13 +139,13 @@ namespace Amarok const int handle = temp.handle(); -// QCString gdb_command_string = +// TQCString gdb_command_string = // "file amarokapp\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" @@ -160,23 +160,23 @@ namespace Amarok ::dup2( fileno( stdout ), fileno( stderr ) ); - QCString gdb; + TQCString gdb; gdb = "gdb --nw -n --batch -x "; gdb += temp.name().latin1(); gdb += " amarokapp "; - 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 amarokapp`" ); + const TQString fileCommandOutput = runCommand( "file `which amarokapp`" ); if( fileCommandOutput.find( "not stripped", false ) == -1 ) subject += "[___stripped]"; //same length as below @@ -184,24 +184,24 @@ namespace Amarok 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 useful = false; - subject += QString("[%1]").arg( AmarokConfig::soundSystem().remove( QRegExp("-?engine") ) ); + subject += TQString("[%1]").arg( AmarokConfig::soundSystem().remove( TQRegExp("-?engine") ) ); std::cout << subject.latin1() << std::endl; @@ -221,12 +221,12 @@ namespace Amarok //TODO startup notification kapp->invokeMailer( /*to*/ "[email protected]", - /*cc*/ QString(), - /*bcc*/ QString(), + /*cc*/ TQString(), + /*bcc*/ TQString(), /*subject*/ subject, /*body*/ body, - /*messageFile*/ QString(), - /*attachURLs*/ QStringList(), + /*messageFile*/ TQString(), + /*attachURLs*/ TQStringList(), /*startup_id*/ "" ); } else { @@ -255,9 +255,9 @@ namespace Amarok #if 0 -#include <qlabel.h> -#include <qlayout.h> -#include <qvbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqvbox.h> #include <kdialog.h> #include <kpushbutton.h> #include <kstdguiitem.h> @@ -265,20 +265,20 @@ namespace Amarok Amarok::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>" "Amarok 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 Amarok will prepare an email that you " @@ -286,16 +286,16 @@ Amarok::CrashHandlerWidget::CrashHandlerWidget() "as soon as possible." "<p>" "Thanks for choosing Amarok.<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()) ); + connect( child( "email" ), TQT_SIGNAL(clicked()), TQT_SLOT(accept()) ); + connect( child( "close" ), TQT_SIGNAL(clicked()), TQT_SLOT(reject()) ); setCaption( i18n("Crash Handler") ); setFixedSize( sizeHint() ); |