diff options
-rw-r--r-- | src/androiddeployqt/main.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp index 925f2c5b7..483f75d31 100644 --- a/src/androiddeployqt/main.cpp +++ b/src/androiddeployqt/main.cpp @@ -1656,11 +1656,16 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies) QString rootPath = options->rootPath; if (rootPath.isEmpty()) - rootPath = QFileInfo(options->inputFileName).path(); + rootPath = QFileInfo(options->inputFileName).absolutePath(); + else + rootPath = QFileInfo(rootPath).absoluteFilePath(); + + if (!rootPath.endsWith(QLatin1Char('/'))) + rootPath += QLatin1Char('/'); QStringList importPaths; importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml")); - importPaths += QFileInfo(rootPath).absoluteFilePath(); + importPaths += rootPath; foreach (QString qmlImportPath, options->qmlImportPaths) importPaths += shellQuote(qmlImportPath); @@ -1713,6 +1718,16 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies) continue; } + QString absolutePath = info.absolutePath(); + if (!absolutePath.endsWith(QLatin1Char('/'))) + absolutePath += QLatin1Char('/'); + + if (absolutePath.startsWith(rootPath)) { + if (options->verbose) + fprintf(stdout, " -- Skipping because file is in QML root path.\n"); + continue; + } + QString importPathOfThisImport; foreach (QString importPath, importPaths) { #if defined(Q_OS_WIN32) |