aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-10-06 12:47:31 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2016-10-07 07:35:38 +0000
commitf2648d82ee1ff9e42bf3a41e10fccc10acbe80d5 (patch)
tree120cf5f83e922e556078c01c75ca9dd256020d28 /src
parent2c75537141283895da9b80e249b391bc38d63505 (diff)
API: Fix off-by-one error when setting the install file path
The first character of the install file path would get cut off. Change-Id: I7f7609c08202c009a5a64d062a361e75d789928b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/api/project.cpp2
-rw-r--r--src/lib/corelib/api/projectdata.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/corelib/api/project.cpp b/src/lib/corelib/api/project.cpp
index 39af58c3e..aec1a80ca 100644
--- a/src/lib/corelib/api/project.cpp
+++ b/src/lib/corelib/api/project.cpp
@@ -297,7 +297,7 @@ void ProjectPrivate::setupInstallData(ArtifactData &artifact,
QString installFilePath = ProductInstaller::targetFilePath(product->topLevelProject(),
product->sourceDirectory, artifact.filePath(), artifact.properties().d->m_map, options);
if (!installRoot.isEmpty())
- installFilePath.remove(0, installRoot.count() + 1);
+ installFilePath.remove(0, installRoot.count());
artifact.d->installData.d->installRoot = installRoot;
artifact.d->installData.d->installFilePath = installFilePath;
}
diff --git a/src/lib/corelib/api/projectdata.cpp b/src/lib/corelib/api/projectdata.cpp
index 6e9749714..915c0ff9d 100644
--- a/src/lib/corelib/api/projectdata.cpp
+++ b/src/lib/corelib/api/projectdata.cpp
@@ -46,6 +46,8 @@
#include <tools/propertyfinder.h>
#include <tools/qbsassert.h>
+#include <QDir>
+
#include <algorithm>
namespace qbs {
@@ -381,7 +383,7 @@ QString InstallData::installRoot() const
*/
QString InstallData::localInstallDir() const
{
- return installRoot() + QLatin1Char('/') + installDir();
+ return QDir::cleanPath(installRoot() + QLatin1Char('/') + installDir());
}
/*!
@@ -390,7 +392,7 @@ QString InstallData::localInstallDir() const
*/
QString InstallData::localInstallFilePath() const
{
- return installRoot() + QLatin1Char('/') + installFilePath();
+ return QDir::cleanPath(installRoot() + QLatin1Char('/') + installFilePath());
}
/*!