forked from qt-creator/qt-creator
Qml Tooling: Fix debugging & profiling of .qml files loaded from resources
Don't expect that every url specifying a file is a local file url. Instead let FileInProjectFinder handle urls with other schemes gracefully, too. Change-Id: I72457d502ff1caf52f588e8ec41ab260882d1cf5 Reviewed-on: http://codereview.qt.nokia.com/1840 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
@@ -146,7 +146,7 @@ void QmlProfilerEventStatistics::addRangedEvent(int type, int nestingLevel, int
|
||||
Q_UNUSED(nestingInType);
|
||||
|
||||
const QChar colon = QLatin1Char(':');
|
||||
QString localName, displayName, location, details;
|
||||
QString displayName, location, details;
|
||||
|
||||
if (data.isEmpty())
|
||||
details = tr("Source code not available");
|
||||
@@ -165,8 +165,8 @@ void QmlProfilerEventStatistics::addRangedEvent(int type, int nestingLevel, int
|
||||
displayName = tr("<bytecode>");
|
||||
location = QString("--:%1:%2").arg(QString::number(type), details);
|
||||
} else {
|
||||
localName = QUrl(fileName).toLocalFile();
|
||||
displayName = localName.mid(localName.lastIndexOf(QChar('/')) + 1) + colon + QString::number(line);
|
||||
const QString filePath = QUrl(fileName).path();
|
||||
displayName = filePath.mid(filePath.lastIndexOf(QChar('/')) + 1) + colon + QString::number(line);
|
||||
location = fileName+colon+QString::number(line);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user