From 33541468270f179db5135435e138b42a010ae796 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 18 Oct 2013 14:35:50 +0200 Subject: Allow trailing slash in install root. Currently, removing a directory specified as "dir/" fails, because the file name is empty according to Qt logic. Therefore, remove such trailing slashes first. Change-Id: I3e5e3c9536dbdf9d20d56f9b19b4d30473161cb7 Reviewed-by: Joerg Bornemann --- src/lib/tools/installoptions.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/tools/installoptions.cpp b/src/lib/tools/installoptions.cpp index 6b01cde5f..6e73e14f2 100644 --- a/src/lib/tools/installoptions.cpp +++ b/src/lib/tools/installoptions.cpp @@ -28,6 +28,7 @@ ****************************************************************************/ #include "installoptions.h" +#include #include namespace qbs { @@ -98,11 +99,15 @@ QString InstallOptions::installRoot() const /*! * \brief Sets the base directory for the installation. * \note The argument must either be an empty string or an absolute path to a directory - * (which might not yet exists, in which case it will be created). + * (which might not yet exist, in which case it will be created). */ void InstallOptions::setInstallRoot(const QString &installRoot) { d->installRoot = installRoot; + if (!QDir(installRoot).isRoot()) { + while (d->installRoot.endsWith(QLatin1Char('/'))) + d->installRoot.chop(1); + } } /*! -- cgit v1.2.3