summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/androiddeployqt/main.cpp59
-rw-r--r--src/tools/moc/moc.h5
2 files changed, 19 insertions, 45 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index ac48acb34d..438845c862 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -1813,7 +1813,7 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
qPrintable(object.value(QLatin1String("name")).toString()));
} else {
if (options->verbose)
- fprintf(stdout, " -- Adding '%s' as QML dependency\n", qPrintable(path));
+ fprintf(stdout, " -- Adding '%s' as QML dependency\n", path.toLocal8Bit().constData());
QFileInfo info(path);
@@ -1853,57 +1853,30 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
return false;
}
- importPathOfThisImport = QDir(importPathOfThisImport).absolutePath() + QLatin1Char('/');
- QList<QtDependency> qmlImportsDependencies;
- auto collectQmlDependency = [&usedDependencies, &qmlImportsDependencies,
- &importPathOfThisImport](const QString &filePath) {
- if (!usedDependencies->contains(filePath)) {
- usedDependencies->insert(filePath);
- qmlImportsDependencies += QtDependency(
- QLatin1String("qml/") + filePath.mid(importPathOfThisImport.size()),
- filePath);
- }
- };
-
-
QDir dir(importPathOfThisImport);
importPathOfThisImport = dir.absolutePath() + QLatin1Char('/');
const QList<QtDependency> fileNames = findFilesRecursively(*options, info, importPathOfThisImport);
for (QtDependency fileName : fileNames) {
- if (!usedDependencies->contains(fileName.absolutePath) && fileName.absolutePath.endsWith(QLatin1String(".so")) && checkArchitecture(*options, fileName.absolutePath)) {
- QSet<QString> remainingDependencies;
- if (readDependenciesFromElf(options, fileName.absolutePath, usedDependencies, &remainingDependencies))
- collectQmlDependency(fileName.absolutePath);
- }
- }
-
- QFileInfo qmldirFileInfo = QFileInfo(path + QLatin1Char('/') + QLatin1String("qmldir"));
- if (qmldirFileInfo.exists()) {
- collectQmlDependency(qmldirFileInfo.absoluteFilePath());
- }
+ if (usedDependencies->contains(fileName.absolutePath))
+ continue;
- QVariantList qmlFiles =
- object.value(QLatin1String("components")).toArray().toVariantList();
- qmlFiles.append(object.value(QLatin1String("scripts")).toArray().toVariantList());
- bool qmlFilesMissing = false;
- for (const auto &qmlFileEntry : qmlFiles) {
- QFileInfo fileInfo(qmlFileEntry.toString());
- if (!fileInfo.exists()) {
- qmlFilesMissing = true;
- break;
- }
- collectQmlDependency(fileInfo.absoluteFilePath());
- }
+ usedDependencies->insert(fileName.absolutePath);
- if (qmlFilesMissing) {
if (options->verbose)
- fprintf(stdout,
- " -- Skipping because the required qml files are missing.\n");
- continue;
- }
+ fprintf(stdout, " -- Appending dependency found by qmlimportscanner: %s\n", qPrintable(fileName.absolutePath));
+
+ // Put all imports in default import path in assets
+ fileName.relativePath.prepend(QLatin1String("qml/"));
+ options->qtDependencies[options->currentArchitecture].append(fileName);
- options->qtDependencies[options->currentArchitecture].append(qmlImportsDependencies);
+ if (fileName.absolutePath.endsWith(QLatin1String(".so")) && checkArchitecture(*options, fileName.absolutePath)) {
+ QSet<QString> remainingDependencies;
+ if (!readDependenciesFromElf(options, fileName.absolutePath, usedDependencies, &remainingDependencies))
+ return false;
+
+ }
+ }
}
}
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
index a3e20a061e..531fde70a1 100644
--- a/src/tools/moc/moc.h
+++ b/src/tools/moc/moc.h
@@ -37,7 +37,8 @@
#include <qjsonarray.h>
#include <qjsonobject.h>
#include <stdio.h>
-#include <ctype.h>
+
+#include <private/qtools_p.h>
QT_BEGIN_NAMESPACE
@@ -125,7 +126,7 @@ struct PropertyDef
{
bool stdCppSet() const {
QByteArray s("set");
- s += toupper(name[0]);
+ s += QtMiscUtils::toAsciiUpper(name[0]);
s += name.mid(1);
return (s == write);
}