diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2012-06-01 13:29:53 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2012-06-01 13:45:55 +0200 |
commit | b29e28974f855ab89557e16504c7ad612d37db49 (patch) | |
tree | 9c83f8bda36d24fe5b11a3ca10b089c6fc7f4a70 /src/libs/installer/link.cpp | |
parent | 2e9e3c41221023cc4bd26b73864b4fba72aa3db4 (diff) |
Revert "windows needs to know that the link will be a directory"
- better is to use it on existing directory
This reverts commit a240e7dbadc3f0cbcd4a483ddf7093562df8ca37.
Change-Id: I9103174eaa392a28b7a278ca9343a94b66d76e80
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Diffstat (limited to 'src/libs/installer/link.cpp')
-rw-r--r-- | src/libs/installer/link.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libs/installer/link.cpp b/src/libs/installer/link.cpp index 0ac597e1b..3be5099ab 100644 --- a/src/libs/installer/link.cpp +++ b/src/libs/installer/link.cpp @@ -144,8 +144,9 @@ Link createJunction(const QString &linkPath, const QString &targetPath) TCHAR szDestDir[1024] = L"\\??\\"; //you need this to create valid unicode junctions + QString normalizedTargetPath = QString(targetPath).replace(QLatin1Char('/'), QLatin1Char('\\')); //now we add the real absolute path - StringCchCat(szDestDir, 1024, targetPath.utf16()); + StringCchCat(szDestDir, 1024, normalizedTargetPath.utf16()); // Allocates a block of memory for an array of num elements(1) and initializes all its bits to zero. _REPARSE_DATA_BUFFER* reparseStructData = (_REPARSE_DATA_BUFFER*)calloc(1, @@ -228,9 +229,7 @@ Link::Link(const QString &path) : m_path(path) Link Link::create(const QString &link, const QString &targetPath) { QStringList pathParts = QFileInfo(link).absoluteFilePath().split(QLatin1Char('/')); - pathParts.removeLast(); - QString linkPath = pathParts.join(QLatin1String("/")); bool linkPathExists = QFileInfo(linkPath).exists(); if (!linkPathExists) @@ -242,13 +241,11 @@ Link Link::create(const QString &link, const QString &targetPath) } #ifdef Q_OS_WIN - QString normalizedTargetPath = QString(targetPath).replace(QLatin1Char('/'), QLatin1Char('\\')); - if (normalizedTargetPath.endsWith(QLatin1Char('\\'))) + if (QFileInfo(targetPath).isDir()) return createJunction(link, targetPath); qWarning() << QString::fromLatin1("At the moment the %1 can not create anything else as "\ - "junctions for directories under windows (targetPath needs a seperator at the end)").arg( - QLatin1String(Q_FUNC_INFO)); + "junctions for directories under windows").arg(QLatin1String(Q_FUNC_INFO)); return Link(link); #else return createLnSymlink(link, targetPath); |