[SCM] Kaboom - Debian KDE 3->4 migration tool branch, master, updated. master/1.1.1-14-g6db9c53
George Kiagiadakis
gkiagia-guest at alioth.debian.org
Wed Jul 8 15:01:42 UTC 2009
The following commit has been merged in the master branch:
commit 711992b3fab0b05d0fa379f5d3d4126de1e32829
Author: George Kiagiadakis <kiagiadakis.george at gmail.com>
Date: Wed Jul 8 17:38:37 2009 +0300
recursiveCpDir: Correctly remove the destination directory if it is a symlink.
---
diroperations/recursivedirjob.cpp | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/diroperations/recursivedirjob.cpp b/diroperations/recursivedirjob.cpp
index 1fe20fd..ad933d5 100644
--- a/diroperations/recursivedirjob.cpp
+++ b/diroperations/recursivedirjob.cpp
@@ -238,9 +238,14 @@ void RecursiveDirJobHelper::recursiveCpDir(const QString & sourcePath, const QSt
QDir dest(destPath);
if ( dest.exists() ) {
- if ( options & RecursiveDirJob::RemoveDestination )
- recursiveRmDir(destPath);
- else if ( !(options & RecursiveDirJob::OverWrite) ) {
+ if ( options & RecursiveDirJob::RemoveDestination ) {
+ //in case the destination is a symlink to another directory, we remove first
+ //the symlink target (returned by dest.canonicalPath()) and then the symlink itself.
+ recursiveRmDir(dest.canonicalPath());
+ if ( QFileInfo(destPath).isSymLink() ) {
+ QFile::remove(destPath);
+ }
+ } else if ( !(options & RecursiveDirJob::OverWrite) ) {
emit errorOccured(Error(Error::FileOrDirectoryExists, destPath));
return;
}
--
Kaboom - Debian KDE 3->4 migration tool
More information about the pkg-kde-commits
mailing list