mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 10:22:50 +00:00
kcachegrind: use loop-local variables
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
63fcd7b8ab
commit
e82f781202
3 changed files with 7 additions and 10 deletions
|
@ -130,11 +130,10 @@ int main(int argc, char** argv)
|
||||||
for ( it = d->functionMap().begin(); it != d->functionMap().end(); ++it )
|
for ( it = d->functionMap().begin(); it != d->functionMap().end(); ++it )
|
||||||
flist.append(&(*it));
|
flist.append(&(*it));
|
||||||
|
|
||||||
TraceFunction *f;
|
foreach(TraceFunction *f, d->functionCycles())
|
||||||
foreach(f, d->functionCycles())
|
|
||||||
flist.append(f);
|
flist.append(f);
|
||||||
|
|
||||||
foreach(f, flist) {
|
foreach(TraceFunction *f, flist) {
|
||||||
if (sortByCount)
|
if (sortByCount)
|
||||||
hc.addCost(f, f->calledCount());
|
hc.addCost(f, f->calledCount());
|
||||||
else if (sortByExcl)
|
else if (sortByExcl)
|
||||||
|
@ -149,7 +148,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
out.setFieldAlignment(QTextStream::AlignRight);
|
out.setFieldAlignment(QTextStream::AlignRight);
|
||||||
for(int i=0; i<hc.realCount(); i++) {
|
for(int i=0; i<hc.realCount(); i++) {
|
||||||
f = (TraceFunction*)hc[i];
|
TraceFunction *f = (TraceFunction*)hc[i];
|
||||||
|
|
||||||
if (showCalls) {
|
if (showCalls) {
|
||||||
if (i>0) out << endl;
|
if (i>0) out << endl;
|
||||||
|
|
|
@ -3659,13 +3659,12 @@ ProfileCostArray* TraceData::search(ProfileContext::Type t, QString name,
|
||||||
|
|
||||||
TraceFunctionCycle* TraceData::functionCycle(TraceFunction* f)
|
TraceFunctionCycle* TraceData::functionCycle(TraceFunction* f)
|
||||||
{
|
{
|
||||||
TraceFunctionCycle* cycle;
|
foreach(TraceFunctionCycle* cycle, _functionCycles)
|
||||||
foreach(cycle, _functionCycles)
|
|
||||||
if (cycle->base() == f)
|
if (cycle->base() == f)
|
||||||
return cycle;
|
return cycle;
|
||||||
|
|
||||||
_functionCycleCount++;
|
_functionCycleCount++;
|
||||||
cycle = new TraceFunctionCycle(f, _functionCycleCount);
|
TraceFunctionCycle* cycle = new TraceFunctionCycle(f, _functionCycleCount);
|
||||||
|
|
||||||
_functionCycles.append(cycle);
|
_functionCycles.append(cycle);
|
||||||
return cycle;
|
return cycle;
|
||||||
|
|
|
@ -232,10 +232,9 @@ void PartView::refresh()
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
QList<QTreeWidgetItem*> items;
|
QList<QTreeWidgetItem*> items;
|
||||||
QTreeWidgetItem* item;
|
|
||||||
foreach(TracePart* part, _data->parts()) {
|
foreach(TracePart* part, _data->parts()) {
|
||||||
if (hidden.contains(part)) continue;
|
if (hidden.contains(part)) continue;
|
||||||
item = new PartListItem(0, f, _eventType, _groupType, part);
|
QTreeWidgetItem* item = new PartListItem(0, f, _eventType, _groupType, part);
|
||||||
items.append(item);
|
items.append(item);
|
||||||
}
|
}
|
||||||
setSortingEnabled(false);
|
setSortingEnabled(false);
|
||||||
|
@ -244,7 +243,7 @@ void PartView::refresh()
|
||||||
header()->setSortIndicatorShown(false);
|
header()->setSortIndicatorShown(false);
|
||||||
header()->resizeSections(QHeaderView::ResizeToContents);
|
header()->resizeSections(QHeaderView::ResizeToContents);
|
||||||
|
|
||||||
foreach(item, items) {
|
foreach(QTreeWidgetItem* item, items) {
|
||||||
TracePart* part = ((PartListItem*)item)->part();
|
TracePart* part = ((PartListItem*)item)->part();
|
||||||
if (hidden.contains(part)) continue;
|
if (hidden.contains(part)) continue;
|
||||||
if (part->isActive()) {
|
if (part->isActive()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue