MacDeployQt: Handle absolute paths
authorTim Murison <tim.murison@spectrumdt.com>
Sat, 29 Nov 2014 03:10:51 +0000 (22:10 -0500)
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>
Fri, 6 Feb 2015 08:37:30 +0000 (08:37 +0000)
Correctly compute 'cdupCount' when macdeployqt is
invoked on an absolute path.

Task-number: QTBUG-42954
Change-Id: Id7939610dfb4468b59fcb9dafc2e5da2b578ddba
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
src/macdeployqt/shared/shared.cpp

index a6f0d12..928dbff 100644 (file)
@@ -436,7 +436,7 @@ void recursiveCopyAndDeploy(const QString &appBundlePath, const QString &sourceP
 
             // The (relative) link; with a correct number of "../"'s.
             QString linkPath = QStringLiteral("PlugIns/quick/") + file;
-            int cdupCount = linkDestinationPath.count(QStringLiteral("/"));
+            int cdupCount = linkDestinationPath.count(QStringLiteral("/")) - appBundlePath.count(QStringLiteral("/"));
             for (int i = 0; i < cdupCount - 2; ++i)
                 linkPath.prepend("../");