QmlInspector: Fix mapping of file names to source dir on Mac

Qml Applications by default copy the qml files into XX.app/Contents/Resources in
the shadow build directory. Take this into account when trying to find the files in the source directory.

Reviewed-by: Alessandro Portale
This commit is contained in:
Kai Koehne
2010-11-05 15:34:11 +01:00
parent 4f33fbc229
commit eac940cd01

View File

@@ -566,6 +566,13 @@ QString InspectorUi::filenameForShadowBuildFile(const QString &filename) const
if (projectDir.exists() && buildDir.exists() && fileInfo.exists()) {
if (fileInfo.absoluteFilePath().startsWith(buildDir.canonicalPath())) {
QString fileRelativePath = fileInfo.canonicalFilePath().mid(debugProjectBuildDirectory().length());
#ifdef Q_OS_MACX
// Qt Quick Applications by default copy the qml directory to buildDir()/X.app/Contents/Resources
static QRegExp resourceBundlePattern(QLatin1String("^.*\\.app/Contents/Resources/"));
fileRelativePath.remove(resourceBundlePattern);
#endif
QFileInfo projectFile(projectDir.canonicalPath() + QLatin1Char('/') + fileRelativePath);
if (projectFile.exists())