From ffe8a83e053396df448e9413828527613ca3bd46 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:46:43 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdecore/kdebug.cpp | 146 ++++++++++++++++++++++++++--------------------------- 1 file changed, 73 insertions(+), 73 deletions(-) (limited to 'kdecore/kdebug.cpp') diff --git a/kdecore/kdebug.cpp b/kdecore/kdebug.cpp index 4c9c7cf14..38e45daf6 100644 --- a/kdecore/kdebug.cpp +++ b/kdecore/kdebug.cpp @@ -32,19 +32,19 @@ #include "kinstance.h" #include "kstandarddirs.h" -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -68,19 +68,19 @@ class KDebugEntry; class KDebugEntry { public: - KDebugEntry (int n, const QCString& d) {number=n; descr=d;} + KDebugEntry (int n, const TQCString& d) {number=n; descr=d;} unsigned int number; - QCString descr; + TQCString descr; }; -static QIntDict *KDebugCache; +static TQIntDict *KDebugCache; -static KStaticDeleter< QIntDict > kdd; +static KStaticDeleter< TQIntDict > kdd; -static QCString getDescrFromNum(unsigned int _num) +static TQCString getDescrFromNum(unsigned int _num) { if (!KDebugCache) { - kdd.setObject(KDebugCache, new QIntDict( 601 )); + kdd.setObject(KDebugCache, new TQIntDict( 601 )); // Do not call this deleter from ~KApplication KGlobal::unregisterStaticDeleter(&kdd); KDebugCache->setAutoDelete(true); @@ -91,21 +91,21 @@ static QCString getDescrFromNum(unsigned int _num) return ent->descr; if ( !KDebugCache->isEmpty() ) // areas already loaded - return QCString(); + return TQCString(); - QString filename(locate("config","kdebug.areas")); + TQString filename(locate("config","kdebug.areas")); if (filename.isEmpty()) - return QCString(); + return TQCString(); - QFile file(filename); + TQFile file(filename); if (!file.open(IO_ReadOnly)) { qWarning("Couldn't open %s", filename.local8Bit().data()); file.close(); - return QCString(); + return TQCString(); } uint lineNumber=0; - QCString line(1024); + TQCString line(1024); int len; while (( len = file.readLine(line.data(),line.size()-1) ) > 0) { @@ -143,7 +143,7 @@ static QCString getDescrFromNum(unsigned int _num) if ( ent ) return ent->descr; - return QCString(); + return TQCString(); } enum DebugLevels { @@ -160,7 +160,7 @@ struct kDebugPrivate { ~kDebugPrivate() { delete config; } - QCString aAreaName; + TQCString aAreaName; unsigned int oldarea; KConfig *config; }; @@ -197,7 +197,7 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char } if (kDebug_data->config && kDebug_data->oldarea != nArea) { - kDebug_data->config->setGroup( QString::number(static_cast(nArea)) ); + kDebug_data->config->setGroup( TQString::number(static_cast(nArea)) ); kDebug_data->oldarea = nArea; if ( nArea > 0 && KGlobal::_instance ) kDebug_data->aAreaName = getDescrFromNum(nArea); @@ -207,11 +207,11 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char } int nPriority = 0; - QString aCaption; + TQString aCaption; /* Determine output */ - QString key; + TQString key; switch( nLevel ) { case KDEBUG_INFO: @@ -241,7 +241,7 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char // if no output mode is specified default to no debug output short nOutput = kDebug_data->config ? kDebug_data->config->readNumEntry(key, 4) : 4; - // If the application doesn't have a QApplication object it can't use + // If the application doesn't have a TQApplication object it can't use // a messagebox. if (!kapp && (nOutput == 1)) nOutput = 2; @@ -281,7 +281,7 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char aKey = "ErrorFilename"; break; } - QFile aOutputFile( kDebug_data->config->readPathEntry(aKey, "kdebug.dbg") ); + TQFile aOutputFile( kDebug_data->config->readPathEntry(aKey, "kdebug.dbg") ); aOutputFile.open( IO_WriteOnly | IO_Append | IO_Raw ); aOutputFile.writeBlock( buf, strlen( buf ) ); aOutputFile.close(); @@ -290,10 +290,10 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char case 1: // Message Box { // Since we are in kdecore here, we cannot use KMsgBox and use - // QMessageBox instead + // TQMessageBox instead if ( !kDebug_data->aAreaName.isEmpty() ) - aCaption += QString("(%1)").arg( kDebug_data->aAreaName ); - QMessageBox::warning( 0L, aCaption, data, i18n("&OK") ); + aCaption += TQString("(%1)").arg( kDebug_data->aAreaName ); + TQMessageBox::warning( 0L, aCaption, data, i18n("&OK") ); break; } case 2: // Shell @@ -314,7 +314,7 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char abort(); } -kdbgstream &perror( kdbgstream &s) { return s << QString::fromLocal8Bit(strerror(errno)); } +kdbgstream &perror( kdbgstream &s) { return s << TQString::fromLocal8Bit(strerror(errno)); } kdbgstream kdDebug(int area) { return kdbgstream(area, KDEBUG_INFO); } kdbgstream kdDebug(bool cond, int area) { if (cond) return kdbgstream(area, KDEBUG_INFO); else return kdbgstream(0, 0, false); } @@ -335,7 +335,7 @@ void kdbgstream::flush() { if (output.isEmpty() || !print) return; kDebugBackend( level, area, output.local8Bit().data() ); - output = QString::null; + output = TQString::null; } kdbgstream &kdbgstream::form(const char *format, ...) @@ -361,7 +361,7 @@ kdbgstream& kdbgstream::operator << (char ch) { if (!print) return *this; if (!isprint(ch)) - output += "\\x" + QString::number( static_cast( ch ), 16 ).rightJustify(2, '0'); + output += "\\x" + TQString::number( static_cast( ch ), 16 ).rightJustify(2, '0'); else { output += ch; if (ch == '\n') flush(); @@ -369,11 +369,11 @@ kdbgstream& kdbgstream::operator << (char ch) return *this; } -kdbgstream& kdbgstream::operator << (QChar ch) +kdbgstream& kdbgstream::operator << (TQChar ch) { if (!print) return *this; if (!ch.isPrint()) - output += "\\x" + QString::number( ch.unicode(), 16 ).rightJustify(2, '0'); + output += "\\x" + TQString::number( ch.unicode(), 16 ).rightJustify(2, '0'); else { output += ch; if (ch == '\n') flush(); @@ -381,33 +381,33 @@ kdbgstream& kdbgstream::operator << (QChar ch) return *this; } -kdbgstream& kdbgstream::operator << (QWidget* widget) +kdbgstream& kdbgstream::operator << (TQWidget* widget) { - return *this << const_cast< const QWidget* >( widget ); + return *this << const_cast< const TQWidget* >( widget ); } -kdbgstream& kdbgstream::operator << (const QWidget* widget) +kdbgstream& kdbgstream::operator << (const TQWidget* widget) { - QString string, temp; + TQString string, temp; // ----- if(widget==0) { - string=(QString)"[Null pointer]"; + string=(TQString)"[Null pointer]"; } else { temp.setNum((ulong)widget, 16); - string=(QString)"["+widget->className()+" pointer " + string=(TQString)"["+widget->className()+" pointer " + "(0x" + temp + ")"; if(widget->name(0)==0) { string += " to unnamed widget, "; } else { - string += (QString)" to widget " + widget->name() + ", "; + string += (TQString)" to widget " + widget->name() + ", "; } string += "geometry=" - + QString().setNum(widget->width()) - + "x"+QString().setNum(widget->height()) - + "+"+QString().setNum(widget->x()) - + "+"+QString().setNum(widget->y()) + + TQString().setNum(widget->width()) + + "x"+TQString().setNum(widget->height()) + + "+"+TQString().setNum(widget->x()) + + "+"+TQString().setNum(widget->y()) + "]"; } if (!print) @@ -423,40 +423,40 @@ kdbgstream& kdbgstream::operator << (const QWidget* widget) } /* * either use 'output' directly and do the flush if needed - * or use the QString operator which calls the char* operator + * or use the TQString operator which calls the char* operator * */ -kdbgstream& kdbgstream::operator<<( const QDateTime& time) { +kdbgstream& kdbgstream::operator<<( const TQDateTime& time) { *this << time.toString(); return *this; } -kdbgstream& kdbgstream::operator<<( const QDate& date) { +kdbgstream& kdbgstream::operator<<( const TQDate& date) { *this << date.toString(); return *this; } -kdbgstream& kdbgstream::operator<<( const QTime& time ) { +kdbgstream& kdbgstream::operator<<( const TQTime& time ) { *this << time.toString(); return *this; } -kdbgstream& kdbgstream::operator<<( const QPoint& p ) { +kdbgstream& kdbgstream::operator<<( const TQPoint& p ) { *this << "(" << p.x() << ", " << p.y() << ")"; return *this; } -kdbgstream& kdbgstream::operator<<( const QSize& s ) { +kdbgstream& kdbgstream::operator<<( const TQSize& s ) { *this << "[" << s.width() << "x" << s.height() << "]"; return *this; } -kdbgstream& kdbgstream::operator<<( const QRect& r ) { +kdbgstream& kdbgstream::operator<<( const TQRect& r ) { *this << "[" << r.x() << "," << r.y() << " - " << r.width() << "x" << r.height() << "]"; return *this; } -kdbgstream& kdbgstream::operator<<( const QRegion& reg ) { +kdbgstream& kdbgstream::operator<<( const TQRegion& reg ) { *this<< "[ "; - QMemArrayrs=reg.rects(); + TQMemArrayrs=reg.rects(); for (uint i=0;i