aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/jsextensions
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-01-11 15:42:55 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2019-01-11 17:35:37 +0000
commit90588a6a719aa143500d480582ae2de733ac7c0d (patch)
tree7520f49f81099cc57d4a8b51727267333a668c92 /src/lib/corelib/jsextensions
parent34ef874fee31f05e2bd3d789f94b29771907322c (diff)
Darwin support: Work around issue with canonical paths
When built with Qt >= 5.12, we pass a canonical output directory to macOS' actool, but amazingly, it somehow manages to list the file paths it created there in the non-canonical version. So we need to re- canonicalize these paths. Fixes: QBS-1417 Change-Id: I2cfcf7cdef0a16a1e69e0320651eabf4f3355307 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/jsextensions')
-rw-r--r--src/lib/corelib/jsextensions/temporarydir.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/corelib/jsextensions/temporarydir.cpp b/src/lib/corelib/jsextensions/temporarydir.cpp
index 9f0eb25a9..6dece5dc3 100644
--- a/src/lib/corelib/jsextensions/temporarydir.cpp
+++ b/src/lib/corelib/jsextensions/temporarydir.cpp
@@ -40,6 +40,7 @@
#include <language/scriptengine.h>
+#include <QtCore/qfileinfo.h>
#include <QtCore/qobject.h>
#include <QtCore/qtemporarydir.h>
#include <QtCore/qvariant.h>
@@ -51,6 +52,14 @@
namespace qbs {
namespace Internal {
+static bool tempDirIsCanonical()
+{
+#if QT_VERSION >= 0x050c00
+ return true;
+#endif
+ return false;
+}
+
class TemporaryDir : public QObject, public QScriptable
{
Q_OBJECT
@@ -90,7 +99,7 @@ bool TemporaryDir::isValid() const
QString TemporaryDir::path() const
{
- return dir.path();
+ return tempDirIsCanonical() ? dir.path() : QFileInfo(dir.path()).canonicalFilePath();
}
bool TemporaryDir::remove()