summaryrefslogtreecommitdiffstats
path: root/src/libs/ifwtools/binarycreator.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-12-11 11:50:12 +0200
committerKatja Marttila <katja.marttila@qt.io>2020-12-21 09:15:26 +0200
commit2e29ed1ec128e5d31c8294c77c215f4649c44140 (patch)
treec2097829778644cb109210bddd702ce8902337a6 /src/libs/ifwtools/binarycreator.cpp
parent4e7de73c260d56cf6fabd76fbb66d5b7321ca597 (diff)
Copy highdpi images as resource to installer
HighDPI images are needed when scalefactor is set so that images don't look low quality Task-number: QTIFW-2080 Change-Id: Ic5b8db0bae31674269b01cc4dcabae7901a62793 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/ifwtools/binarycreator.cpp')
-rw-r--r--src/libs/ifwtools/binarycreator.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libs/ifwtools/binarycreator.cpp b/src/libs/ifwtools/binarycreator.cpp
index 9c141d1a0..e8d1c3cd4 100644
--- a/src/libs/ifwtools/binarycreator.cpp
+++ b/src/libs/ifwtools/binarycreator.cpp
@@ -60,6 +60,7 @@
using namespace QInstaller;
using namespace QInstallerTools;
+static const QLatin1String scHighDpi("@2x.");
#ifndef Q_OS_WIN
static void chmod755(const QString &absolutFilePath)
@@ -610,6 +611,7 @@ void QInstallerTools::copyConfigData(const QString &configFile, const QString &t
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;
}
@@ -641,6 +643,7 @@ void QInstallerTools::copyConfigData(const QString &configFile, const QString &t
domElement.replaceChild(dom.createTextNode(newName), domElement.firstChild());
QInstallerTools::copyWithException(elementFileInfo.absoluteFilePath(), targetFile, tagName);
+ copyHighDPIImage(elementFileInfo, tagName, targetFile);
}
QInstaller::openForWrite(&configXml);
@@ -650,6 +653,18 @@ void QInstallerTools::copyConfigData(const QString &configFile, const QString &t
qDebug() << "done.\n";
}
+void QInstallerTools::copyHighDPIImage(const QFileInfo &childFileInfo,
+ const QString &childName, const QString &targetFile)
+{
+ //Copy also highdpi image if present
+ const QFileInfo childFileInfoHighDpi = QFileInfo(childFileInfo.absolutePath(), childFileInfo.baseName() + scHighDpi + childFileInfo.suffix());
+ if (childFileInfoHighDpi.exists()) {
+ const QFileInfo tf(targetFile);
+ const QString highDpiTarget = tf.absolutePath() + QLatin1Char('/') + tf.baseName() + scHighDpi + tf.suffix();
+ QInstallerTools::copyWithException(childFileInfoHighDpi.absoluteFilePath(), highDpiTarget, childName);
+ }
+}
+
int QInstallerTools::createBinary(BinaryCreatorArgs args, QString &argumentError)
{
// increase maximum numbers of file descriptors