diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2013-10-18 14:35:50 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-10-18 14:41:05 +0200 |
commit | 33541468270f179db5135435e138b42a010ae796 (patch) | |
tree | c066f32c026d58618d54a6688634543ee89b1467 | |
parent | 690b4c2674066ade3c8e82e5a48bb102e19b2a8c (diff) |
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 <joerg.bornemann@digia.com>
-rw-r--r-- | src/lib/tools/installoptions.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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 <QDir> #include <QSharedData> 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); + } } /*! |