Android: fix path issue with backslashes on Windows

The androiddeployqt tool wasn't handling dependencies with backslashes
properly, some dependencies like libplugins_platforms_qtforandroid was
written into libs.xml as
plugins\platforms\libplugins_platforms_qtforandroid_armeabi, the the app
won't be looking for the correct path of the lib to load.

Task-number: QTBUG-87574
Change-Id: Iad8c74d30d090adf69a17f2dafb455dff50b3d99
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Assam Boudjelthia 2020-10-14 20:27:07 +03:00
parent 871392790e
commit 3d8447de59

View File

@ -1630,7 +1630,7 @@ bool readAndroidDependencyXml(Options *options,
}
} else if (reader.name() == QLatin1String("jar")) {
int bundling = reader.attributes().value(QLatin1String("bundling")).toInt();
QString fileName = reader.attributes().value(QLatin1String("file")).toString();
QString fileName = QDir::cleanPath(reader.attributes().value(QLatin1String("file")).toString());
if (bundling == (options->deploymentMechanism == Options::Bundled)) {
QtDependency dependency(fileName, absoluteFilePath(options, fileName));
if (!usedDependencies->contains(dependency.absolutePath)) {
@ -1646,7 +1646,7 @@ bool readAndroidDependencyXml(Options *options,
options->initClasses.append(reader.attributes().value(QLatin1String("initClass")).toString());
}
} else if (reader.name() == QLatin1String("lib")) {
QString fileName = reader.attributes().value(QLatin1String("file")).toString();
QString fileName = QDir::cleanPath(reader.attributes().value(QLatin1String("file")).toString());
if (reader.attributes().hasAttribute(QLatin1String("replaces"))) {
QString replaces = reader.attributes().value(QLatin1String("replaces")).toString();
for (int i=0; i<options->localLibs.size(); ++i) {