summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/createshortcutoperation.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-06-19 12:40:35 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-06-19 16:03:36 +0200
commit8c72dee843ffa91e6e5c63f52a05b11273ed65a7 (patch)
tree3399b9e080bfc0fd59ba11acd711b6d96e83157a /src/libs/installer/createshortcutoperation.cpp
parentcaa8d1dc3771ee28bbc8aba7410dff8746444054 (diff)
Trim whitespaces from path names.
Task-number: QTIFW-276 At least on windows CreateDirectory will trim them anyway, so the shortcut operation will fail as the created directory does not match the arguments passed. Change-Id: I76466ef1d83461559c51021ad2bedaf36a145f51 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/libs/installer/createshortcutoperation.cpp')
-rw-r--r--src/libs/installer/createshortcutoperation.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libs/installer/createshortcutoperation.cpp b/src/libs/installer/createshortcutoperation.cpp
index 2f2696fcd..5e29337bf 100644
--- a/src/libs/installer/createshortcutoperation.cpp
+++ b/src/libs/installer/createshortcutoperation.cpp
@@ -196,10 +196,8 @@ bool CreateShortcutOperation::performOperation()
const QString linkLocation = args.at(1);
const QString targetArguments = args.value(2); //used value because it could be not existing
- const QString linkPath = QFileInfo(linkLocation).absolutePath();
-
- const bool linkPathAlreadyExists = QDir(linkPath).exists();
- const bool created = linkPathAlreadyExists || QDir::root().mkpath(linkPath);
+ const QString linkPath = QFileInfo(linkLocation).absolutePath().trimmed();
+ const bool created = QDir(linkPath).exists() || QDir::root().mkpath(linkPath);
if (!created) {
setError(UserDefinedError);