diff options
author | Katja Marttila <katja.marttila@qt.io> | 2021-10-26 08:50:07 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2022-03-21 17:08:39 +0200 |
commit | 6ec6ac70d98195bb41a5ed60e47984bc640066fc (patch) | |
tree | 28e937e933a18479a9d114aa989d20d5083f7aaa /src/libs/ifwtools/binarycreator.cpp | |
parent | a47cad8ed9e7e0c5ecd4a67c9603332d72228a7c (diff) |
Add click option for product image
Product image can now be clicked. It opens either url in Web browser or
if file reference is given, then it will be opened with the suitable
application.
Task-number: QTIFW-2361
Change-Id: I59ed1355e90c23c8d0a5124779725825ca1ee2c8
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/ifwtools/binarycreator.cpp')
-rw-r--r-- | src/libs/ifwtools/binarycreator.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/libs/ifwtools/binarycreator.cpp b/src/libs/ifwtools/binarycreator.cpp index 95ff93393..7ea652250 100644 --- a/src/libs/ifwtools/binarycreator.cpp +++ b/src/libs/ifwtools/binarycreator.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -609,17 +609,28 @@ void QInstallerTools::copyConfigData(const QString &configFile, const QString &t qDebug().noquote() << QString::fromLatin1("Read dom element: <%1>%2</%1>.").arg(tagName, elementText); if (tagName == QLatin1String("ProductImages")) { - const QDomNodeList childNodes = domElement.childNodes(); - for (int index = 0; index < childNodes.count(); ++index) { - const QDomElement childElement = childNodes.at(index).toElement(); - const QString childName = childElement.tagName(); - if (childName != QLatin1String("Image")) + const QDomNodeList productImageNode = domElement.childNodes(); + for (int j = 0; j < productImageNode.count(); ++j) { + QDomElement productImagesElement = productImageNode.at(j).toElement(); + if (productImagesElement.isNull()) continue; + const QString childName = productImagesElement.tagName(); + if (childName != QLatin1String("ProductImage")) + continue; + const QDomNodeList imageNode = productImagesElement.childNodes(); + for (int k = 0; k < imageNode.count(); ++k) { + QDomElement productImageElement = imageNode.at(k).toElement(); + if (productImageElement.isNull()) + continue; + const QString imageChildName = productImageElement.tagName(); + if (imageChildName != QLatin1String("Image")) + continue; + const QString targetFile = targetDir + QLatin1Char('/') + productImageElement.text(); + const QFileInfo childFileInfo = QFileInfo(sourceConfigFilePath, productImageElement.text()); + QInstallerTools::copyWithException(childFileInfo.absoluteFilePath(), targetFile, imageChildName); + copyHighDPIImage(childFileInfo, imageChildName, targetFile); + } - const QString targetFile = targetDir + QLatin1Char('/') + childElement.text(); - const QFileInfo childFileInfo = QFileInfo(sourceConfigFilePath, childElement.text()); - QInstallerTools::copyWithException(childFileInfo.absoluteFilePath(), targetFile, childName); - copyHighDPIImage(childFileInfo, childName, targetFile); } continue; } |