From 8c72dee843ffa91e6e5c63f52a05b11273ed65a7 Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 19 Jun 2013 12:40:35 +0200 Subject: 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 --- src/libs/installer/createshortcutoperation.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/libs/installer/createshortcutoperation.cpp') 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); -- cgit v1.2.3