diff --git a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp
index 4df2c0afd08..20df7fda225 100644
--- a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp
+++ b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp
@@ -258,37 +258,39 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
if (!d->m_verboseToolTips)
return data(index, Qt::DisplayRole);
- QString ret = "
\n";
+ \n");
+ QString entry = QLatin1String("- %1
- %2
\n");
// body, function info first
- ret += "";
- ret += "- " + tr("Function:") + "
- " + Qt::escape(func->name()) + "
\n";
- ret += "- " + tr("File:") + "
- " + func->file() + "
\n";
+ ret += entry.arg(tr("Function:")).arg(Qt::escape(func->name()));
+ ret += entry.arg(tr("File:")).arg(func->file());
if (!func->costItems().isEmpty()) {
const CostItem *firstItem = func->costItems().first();
for (int i = 0; i < d->m_data->positions().size(); ++i) {
- ret += "- " + ParseData::prettyStringForPosition(d->m_data->positions().at(i)) + "
";
- ret += "- " + QString::number(firstItem->position(i)) + "
\n";
+ ret += entry.arg(ParseData::prettyStringForPosition(d->m_data->positions().at(i)))
+ .arg(firstItem->position(i));
}
}
- ret += "- " + tr("Object:") + "
- " + func->object() + "
\n";
- ret += "- " + tr("Called:") + "
- " + tr("%n time(s)", 0, func->called()) + "
\n";
- ret += "
";
+ ret += entry.arg(tr("Object:")).arg(func->object());
+ ret += entry.arg(tr("Called:")).arg(tr("%n time(s)", 0, func->called()));
+ ret += QLatin1String("
");
// self/inclusive costs
- ret += "";
- ret += "| " + tr("Events") + " | ";
- ret += "" + tr("Self costs") + " | " + tr("(%)") + " | ";
- ret += "" + tr("Incl. costs") + " | " + tr("(%)") + " | ";
- ret += "
";
- ret += "";
+ entry = QLatin1String("%1 | %2 | ");
+ ret += QLatin1String("");
+ ret += QLatin1String("");
+ ret += QLatin1String("| ") + tr("Events") + QLatin1String(" | ");
+ ret += entry.arg(tr("Self costs")).arg(tr("(%)"));
+ ret += entry.arg(tr("Incl. costs")).arg(tr("(%)"));
+ ret += QLatin1String("
");
+ ret += QLatin1String("");
for (int i = 0; i < d->m_data->events().size(); ++i) {
quint64 selfCost = func->selfCost(i);
quint64 inclCost = func->inclusiveCost(i);
@@ -297,16 +299,16 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
const float relSelfCost = (float)qRound((float)selfCost / totalCost * 10000) / 100;
const float relInclCost = (float)qRound((float)inclCost / totalCost * 10000) / 100;
- ret += "";
- ret += "| " + noWrap(ParseData::prettyStringForEvent(d->m_data->events().at(i))) + " | ";
- ret += "" + tr("%1").arg(selfCost) + " | ";
- ret += "" + tr("(%1%)").arg(relSelfCost) + " | ";
- ret += "" + tr("%1").arg(inclCost) + " | ";
- ret += "" + tr("(%1%)").arg(relInclCost) + " | ";
- ret += "
";
+ ret += QLatin1String("");
+ ret += QLatin1String("| ") +
+ noWrap(ParseData::prettyStringForEvent(d->m_data->events().at(i)))
+ + QLatin1String(" | ");
+ ret += entry.arg(selfCost).arg(tr("(%1%)").arg(relSelfCost));
+ ret += entry.arg(inclCost).arg(tr("(%1%)").arg(relInclCost));
+ ret += QLatin1String("
");
}
- ret += "
";
- ret += "";
+ ret += QLatin1String("
");
+ ret += QLatin1String("