--- kprof/parseprofile_fnccheck.h 2002-09-09 23:47:13.000000000 +0200 +++ kprof/parseprofile_fnccheck.h 2005-09-02 11:17:00.000000000 +0200 @@ -22,7 +22,7 @@ #endif class CProfileInfo; -class QString; +class QTextStream; class CParseProfile_fnccheck : public CParseProfile { --- kprof/parseprofile_gprof.h 2002-07-16 20:32:42.000000000 +0200 +++ kprof/parseprofile_gprof.h 2005-09-02 11:17:39.000000000 +0200 @@ -23,6 +23,7 @@ #endif class CProfileInfo; +class QTextStream; class CParseProfile_gprof : public CParseProfile { --- kprof/parseprofile_pose.h 2002-09-09 23:47:13.000000000 +0200 +++ kprof/parseprofile_pose.h 2005-09-02 11:17:20.000000000 +0200 @@ -22,7 +22,7 @@ #endif class CProfileInfo; -class QString; +class QTextStream; class CParseProfile_pose : public CParseProfile { --- kprof/kprofwidget.cpp 2004-10-28 17:03:05.000000000 +0200 +++ kprof/kprofwidget.cpp 2005-09-02 08:31:22.000000000 +0200 @@ -834,15 +834,7 @@ void KProfWidget::gprofStdout (KProcess *, char *buffer, int buflen) { BEGIN; - - char* newbuf = new char[buflen]; - strncpy(newbuf, buffer, buflen); - newbuf[buflen] = '\0'; - - mGProfStdout += QString::fromLocal8Bit (newbuf, buflen); - - delete [] newbuf; - + mGProfStdout += QString::fromLocal8Bit (buffer, buflen); END; } --- kprof/parseprofile_gprof.cpp 2005-08-25 16:08:04.000000000 +0200 +++ kprof/parseprofile_gprof.cpp 2005-08-25 16:11:07.000000000 +0200 @@ -119,8 +119,6 @@ { CProfileInfo *p = new CProfileInfo; p->ind = profile.count (); - p->cumPercent = fields[0].toFloat (); - p->cumSeconds = fields[1].toFloat (); p->selfSeconds = fields[2].toFloat (); if (fields[3][0].isDigit ()) { @@ -221,6 +219,17 @@ if (e->primary == true && count.find ('+') != -1) e->recursive = true; + + // if this is a primary entry, get the total time and percentage + if (e->primary == true) + { + CProfileInfo *tPrimary = locateProfileEntry (e->name, profile); + if (tPrimary != NULL) + { + tPrimary->cumPercent = fields[1].toFloat (); + tPrimary->cumSeconds = tPrimary->selfSeconds + fields[3].toFloat (); + } + } if (callGraphBlock.count () == callGraphBlock.size ()) callGraphBlock.resize (callGraphBlock.size () + 32);