From 1c1403293485f35fd53db45aaa77a01cdd9627e7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 20:34:15 +0000 Subject: TQt4 port ktorrent This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libktorrent/util/profiler.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'libktorrent/util/profiler.cpp') diff --git a/libktorrent/util/profiler.cpp b/libktorrent/util/profiler.cpp index 05c53bd..766012d 100644 --- a/libktorrent/util/profiler.cpp +++ b/libktorrent/util/profiler.cpp @@ -18,19 +18,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef KT_PROFILE -#include -#include +#include +#include #include #include "profiler.h" namespace bt { - Profile::Profile(Profile* parent,const QString & name) : parent(parent),name(name) + Profile::Profile(Profile* tqparent,const TQString & name) : tqparent(tqparent),name(name) { min = max = avg = 0.0; count = 0; start_time = 0.0; - children.setAutoDelete(true); + tqchildren.setAutoDelete(true); } Profile::~Profile() @@ -61,10 +61,10 @@ namespace bt count++; } - Profile* Profile::child(const QString & name) + Profile* Profile::child(const TQString & name) { - QPtrList::iterator i = children.begin(); - while (i != children.end()) + TQPtrList::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { Profile* p = *i; if (p->name == name) @@ -73,19 +73,19 @@ namespace bt } Profile* p = new Profile(this,name); - children.append(p); + tqchildren.append(p); return p; } - void Profile::save(QTextStream & out,const QString & base) + void Profile::save(TQTextStream & out,const TQString & base) { - QString nb = base + "/" + name; + TQString nb = base + "/" + name; out.precision(5); out << qSetW(60) << nb << qSetW(10) << min << qSetW(10) << max << qSetW(10) << avg << qSetW(10) << count << endl; - QPtrList::iterator i = children.begin(); - while (i != children.end()) + TQPtrList::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { Profile* p = *i; p->save(out,nb); @@ -109,7 +109,7 @@ namespace bt delete root; } - void Profiler::start(const QString & s) + void Profiler::start(const TQString & s) { curr = curr->child(s); curr->start(); @@ -121,18 +121,18 @@ namespace bt curr = curr->getParent(); } - void Profiler::saveToFile(const QString & fn) + void Profiler::saveToFile(const TQString & fn) { - QFile fptr(fn); + TQFile fptr(fn); if (!fptr.open(IO_WriteOnly)) return; - QTextStream out(&fptr); + TQTextStream out(&fptr); out << qSetW(60) << "code" << qSetW(10) << "min" << qSetW(10) << "max" << qSetW(10) << "avg" << qSetW(10) << "count" << endl; out << endl; - root->save(out,QString::null); + root->save(out,TQString()); } } #endif -- cgit v1.2.1