From 15cff3e2354f51d702976e704e4202390217c8c6 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Mon, 17 Aug 2020 18:30:10 +0300 Subject: Add support for vendor set image decoration Add possibility to show an arbitrary number of product related, or other images on PerformInstallationPage. These can be specified in the installer configuration file, using element with one child element for each file name. Task-number: QTIFW-1900 Change-Id: I2be727d9189963ef1a79046150111dd8c91153c6 Reviewed-by: Iikka Eklund Reviewed-by: Katja Marttila --- tools/binarycreator/binarycreator.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tools') diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp index a18690a73..6caf3ff1f 100644 --- a/tools/binarycreator/binarycreator.cpp +++ b/tools/binarycreator/binarycreator.cpp @@ -712,6 +712,21 @@ void copyConfigData(const QString &configFile, const QString &targetDir) const QString elementText = domElement.text(); qDebug().noquote() << QString::fromLatin1("Read dom element: <%1>%2.").arg(tagName, elementText); + if (tagName == QLatin1String("ProductImages")) { + const QDomNodeList childNodes = domElement.childNodes(); + for (int i = 0; i < childNodes.count(); ++i) { + const QDomElement childElement = childNodes.at(i).toElement(); + const QString childName = childElement.tagName(); + if (childName != QLatin1String("Image")) + continue; + + const QString targetFile = targetDir + QLatin1Char('/') + childElement.text(); + const QFileInfo childFileInfo = QFileInfo(sourceConfigFilePath, childElement.text()); + QInstallerTools::copyWithException(childFileInfo.absoluteFilePath(), targetFile, childName); + } + continue; + } + QString newName = domElement.text().replace(QRegExp(QLatin1String("\\\\|/|\\.|:")), QLatin1String("_")); -- cgit v1.2.3