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:
Kai Koehne
2011-07-19 17:48:57 +02:00
parent ebf4212f71
commit 51a9ff7d4e
10 changed files with 51 additions and 47 deletions

View File

@@ -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);
}