QmlProfiler: Make members of QmlEventLocation private

You should not change them independently as that is error-prone.

Change-Id: I07890a29b045492fe804b9537094dea763bc1b8d
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-06-06 18:04:53 +02:00
parent a41593c395
commit 472745fb2e
14 changed files with 100 additions and 68 deletions

View File

@@ -57,12 +57,12 @@ public:
QString getDisplayName(const QmlEventType &event)
{
if (event.location.filename.isEmpty()) {
if (event.location.filename().isEmpty()) {
return QmlProfilerDataModel::tr("<bytecode>");
} else {
const QString filePath = QUrl(event.location.filename).path();
const QString filePath = QUrl(event.location.filename()).path();
return filePath.mid(filePath.lastIndexOf(QLatin1Char('/')) + 1) + QLatin1Char(':') +
QString::number(event.location.line);
QString::number(event.location.line());
}
}
@@ -182,7 +182,7 @@ void QmlProfilerDataModel::QmlProfilerDataModelPrivate::rewriteType(int typeInde
return;
// There is no point in looking for invalid locations
if (type.location.filename.isEmpty() || type.location.line < 0 || type.location.column < 0)
if (!type.location.isValid())
return;
detailsRewriter->requestDetailsForLocation(typeIndex, type.location);