[Pkg-owncloud-commits] [owncloud-client] 43/83: Properly report errors when renaming a file

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat May 31 11:31:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit e75c5236f26faa117aa787d65ee98969958ab7b4
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon May 26 14:51:53 2014 +0200

    Properly report errors when renaming a file
    
    That is especially usefull when renaming to an existing file with a different case
---
 src/mirall/propagatorjobs.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mirall/propagatorjobs.cpp b/src/mirall/propagatorjobs.cpp
index 6006435..70faec1 100644
--- a/src/mirall/propagatorjobs.cpp
+++ b/src/mirall/propagatorjobs.cpp
@@ -181,7 +181,10 @@ void PropagateLocalRename::start()
     if (_item._file != _item._renameTarget) {
         emit progress(_item, 0);
         qDebug() << "MOVE " << _propagator->_localDir + _item._file << " => " << _propagator->_localDir + _item._renameTarget;
-        QFile::rename(_propagator->_localDir + _item._file, _propagator->_localDir + _item._renameTarget);
+        QFile file(_propagator->_localDir + _item._file);
+        if (!file.rename(_propagator->_localDir + _item._file, _propagator->_localDir + _item._renameTarget)) {
+            done(SyncFileItem::NormalError, file.errorString());
+        }
     }
 
     _propagator->_journal->deleteFileRecord(_item._originalFile);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list