diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2020-08-17 18:30:10 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2020-08-25 11:37:30 +0300 |
commit | 15cff3e2354f51d702976e704e4202390217c8c6 (patch) | |
tree | 0d6c41ff536f8e68eedf9c70315821aeb561e8a7 /tools/binarycreator/binarycreator.cpp | |
parent | 40c43e4c312c9f1cc4e2e44ac31b4482ccbbc6c0 (diff) |
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 <ProductImages> element with
one <Image> child element for each file name.
Task-number: QTIFW-1900
Change-Id: I2be727d9189963ef1a79046150111dd8c91153c6
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'tools/binarycreator/binarycreator.cpp')
-rw-r--r-- | tools/binarycreator/binarycreator.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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</%1>.").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("_")); |