From f62e1fb36f7170bd132a5ede2c29fa64d1ea0dc5 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 2 Sep 2014 11:33:46 +0200 Subject: Fixed font deployment for winphone 8.0 Change-Id: I8d7a2debfec3bbd06780458a29f11031dd9b862c Reviewed-by: Andrew Knight --- src/plugins/winrt/winrtpackagedeploymentstep.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp index a76f519332..b73d86274b 100644 --- a/src/plugins/winrt/winrtpackagedeploymentstep.cpp +++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp @@ -184,10 +184,26 @@ bool WinRtPackageDeploymentStep::processSucceeded(int exitCode, QProcess::ExitSt relativeRemotePath = QDir(baseDir).relativeFilePath(pair.second); if (QDir(relativeRemotePath).isAbsolute() || relativeRemotePath.startsWith(QLatin1String(".."))) { - // for 3.3? - // raiseWarning(tr("File %1 is outside of the executable's directory. These files cannot be installed.").arg(relativeRemotePath)); - continue; + // special case for winphone 8.0 font deployment + const QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target()->kit()); + if (!qt) + return false; + if (qt->mkspec().toString().contains(QLatin1String("msvc2012"))) { + const QString fileName = relativeRemotePath.mid(relativeRemotePath.lastIndexOf(QLatin1Char('/')) + 1); + if (QFile::exists(m_targetDirPath + QLatin1String("fonts/") + fileName)) { + relativeRemotePath = QLatin1String("fonts/") + fileName; + } else { + // for 3.3? + // raiseWarning(tr("File %1 is outside of the executable's directory. These files cannot be installed.").arg(relativeRemotePath)); + continue; + } + } else { + // for 3.3? + // raiseWarning(tr("File %1 is outside of the executable's directory. These files cannot be installed.").arg(relativeRemotePath)); + continue; + } } + m_mappingFileContent += QLatin1Char('"') + QDir::toNativeSeparators(pair.first) + QLatin1String("\" \"") + QDir::toNativeSeparators(relativeRemotePath) + QLatin1String("\"\n"); -- cgit v1.2.1