QmlProfiler: remove "Source code not available."

This string crops up in far too many places where it's not supposed to
be. If we really need it we should add it to the views in the exact
places where we want it instead of writing it into the model.

Change-Id: I5f17a2aead7f6c2d42f485bf629baaf759e90547
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-06-13 19:16:35 +02:00
parent 22fb31557f
commit f70f4e6f7c
2 changed files with 7 additions and 5 deletions

View File

@@ -85,13 +85,12 @@ QString getInitialDetails(const QmlProfilerDataModel::QmlEventTypeData &event)
{
QString details;
// generate details string
if (event.data.isEmpty())
details = QmlProfilerDataModel::tr("Source code not available.");
else {
if (!event.data.isEmpty()) {
details = event.data;
details.replace(QLatin1Char('\n'),QLatin1Char(' ')).simplified();
if (details.isEmpty()) {
details = QmlProfilerDataModel::tr("anonymous function");
if (event.rangeType == QmlDebug::Javascript)
details = QmlProfilerDataModel::tr("anonymous function");
} else {
QRegExp rewrite(QLatin1String("\\(function \\$(\\w+)\\(\\) \\{ (return |)(.+) \\}\\)"));
bool match = rewrite.exactMatch(details);