Commit ea0dd4ad authored by Kai Koehne's avatar Kai Koehne

JsDebugger: Open original file if breakpoint is hit

Hotfix for Qt Quick Applications: Try to open the original file
by stripping "X.app/Contents/Resources" from the path.

Reviewed-by: Christiaan Janssen
parent f9ba7536
......@@ -818,7 +818,7 @@ QString QmlEngine::mangleFilenamePaths(const QString &filename, const QString &o
if (oldBaseDir.exists() && newBaseDir.exists() && fileInfo.exists()) {
if (fileInfo.absoluteFilePath().startsWith(oldBaseDir.canonicalPath())) {
QString fileRelativePath = fileInfo.canonicalFilePath().mid(oldBasePath.length());
QString fileRelativePath = fileInfo.canonicalFilePath().mid(oldBaseDir.canonicalPath().length());
QFileInfo projectFile(newBaseDir.canonicalPath() + QLatin1Char('/') + fileRelativePath);
if (projectFile.exists())
......@@ -833,7 +833,14 @@ QString QmlEngine::fromShadowBuildFilename(const QString &filename) const
QString newFilename = filename;
QString importPath = qmlImportPath();
newFilename = mangleFilenamePaths(filename, startParameters().projectBuildDir, startParameters().projectDir);
#ifdef Q_OS_MACX
// Qt Quick Applications by default copy the qml directory to buildDir()/X.app/Contents/Resources
const QString applicationBundleDir
= QFileInfo(startParameters().executable).absolutePath() + "/../..";
newFilename = mangleFilenamePaths(newFilename, applicationBundleDir + "/Contents/Resources", startParameters().projectDir);
#endif
newFilename = mangleFilenamePaths(newFilename, startParameters().projectBuildDir, startParameters().projectDir);
if (newFilename == filename && !importPath.isEmpty()) {
newFilename = mangleFilenamePaths(filename, startParameters().projectBuildDir, importPath);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment