[SCM] Kaboom - Debian KDE 3->4 migration tool branch, master, updated. master/0.9.1-44-ga31d620

George Kiagiadakis gkiagia-guest at alioth.debian.org
Sat Apr 4 21:49:40 UTC 2009


The following commit has been merged in the master branch:
commit a31d6206d33f7ececdf98951486b7f96f4086178
Author: George Kiagiadakis <gkiagia at users.sourceforge.net>
Date:   Sun Apr 5 00:45:37 2009 +0300

    If QFileInfo can tell what kind of file it is, there is no need to check if the file exists.
    
    This fixes the bug where a symlink pointing to inexistent file would not be removed in
    the OverWrite scenario, as QFile::exists() actually checks if the file that is pointed
    by the symlink exists and not if the symlink itself exists.

diff --git a/diroperations/recursivedirjob.cpp b/diroperations/recursivedirjob.cpp
index bce095b..4f7ff95 100644
--- a/diroperations/recursivedirjob.cpp
+++ b/diroperations/recursivedirjob.cpp
@@ -276,8 +276,7 @@ void RecursiveDirJobHelper::recursiveCpDir(const QString & sourcePath, const QSt
             if ( currentItem.isSymLink() )
             {
                 if ( options & RecursiveDirJob::OverWrite ) {
-                    if ( QFile::exists(dest.absoluteFilePath(currentName)) &&
-                         !QFile::remove(dest.absoluteFilePath(currentName)) )
+                    if ( !QFile::remove(dest.absoluteFilePath(currentName)) )
                         emit errorOccured(Error(Error::RmFail, dest.absoluteFilePath(currentName)));
                 }
                 if ( !QFile::link( DirOperations::relativeSymLinkTarget(source.absoluteFilePath(currentName)),
@@ -310,8 +309,7 @@ void RecursiveDirJobHelper::recursiveCpDir(const QString & sourcePath, const QSt
             else if ( currentItem.isFile() )
             {
                 if ( options & RecursiveDirJob::OverWrite ) {
-                    if ( QFile::exists(dest.absoluteFilePath(currentName)) &&
-                         !QFile::remove(dest.absoluteFilePath(currentName)) )
+                    if ( !QFile::remove(dest.absoluteFilePath(currentName)) )
                         emit errorOccured(Error(Error::RmFail, dest.absoluteFilePath(currentName)));
                 }
                 if ( !QFile::copy( source.absoluteFilePath(currentName), dest.absoluteFilePath(currentName) ) )

-- 
Kaboom - Debian KDE 3->4 migration tool



More information about the pkg-kde-commits mailing list