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

@@ -676,12 +676,8 @@ void InspectorUi::gotoObjectReferenceDefinition(const QDeclarativeDebugObjectRef
}
QDeclarativeDebugFileReference source = obj.source();
QString fileName = source.url().toLocalFile();
if (source.lineNumber() < 0 || !QFile::exists(fileName))
return;
fileName = m_projectFinder.findFile(fileName);
const QString fileName = m_projectFinder.findFile(source.url());
Core::EditorManager *editorManager = Core::EditorManager::instance();
Core::IEditor *currentEditor = editorManager->currentEditor();
@@ -789,9 +785,9 @@ InspectorUi *InspectorUi::instance()
return m_instance;
}
QString InspectorUi::findFileInProject(const QString &originalPath) const
QString InspectorUi::findFileInProject(const QUrl &url) const
{
return m_projectFinder.findFile(originalPath);
return m_projectFinder.findFile(url);
}
void InspectorUi::setApplyChangesToQmlInspector(bool applyChanges)