diff --git a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp index 4df2c0afd085b0872279349e5c496f595d8634fe..20df7fda2252da971b9748b171cee311f2b3c766 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 += ""; - ret += ""; - ret += ""; - ret += ""; - ret += ""; + entry = QLatin1String(""); + ret += QLatin1String("
" + tr("Events") + "" + tr("Self costs") + "" + tr("(%)") + "" + tr("Incl. costs") + "" + tr("(%)") + "
%1%2
"); + ret += QLatin1String(""); + ret += 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 += ""; - ret += ""; - ret += ""; - ret += ""; - ret += ""; - ret += ""; + ret += QLatin1String(""); + ret += QLatin1String(""); + ret += entry.arg(selfCost).arg(tr("(%1%)").arg(relSelfCost)); + ret += entry.arg(inclCost).arg(tr("(%1%)").arg(relInclCost)); + ret += QLatin1String(""); } - ret += "
") + tr("Events") + QLatin1String("
" + noWrap(ParseData::prettyStringForEvent(d->m_data->events().at(i))) + "" + tr("%1").arg(selfCost) + "" + tr("(%1%)").arg(relSelfCost) + "" + tr("%1").arg(inclCost) + "" + tr("(%1%)").arg(relInclCost) + "
") + + noWrap(ParseData::prettyStringForEvent(d->m_data->events().at(i))) + + QLatin1String("
"; - ret += ""; + ret += QLatin1String(""); + ret += QLatin1String(""); return ret; }