[Pkg-owncloud-commits] [owncloud-client] 49/83: Check for local file name clash before local renaming.
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 964c3ac7bf754885968bab1327b04b96abd01a81
Author: Klaas Freitag <freitag at owncloud.com>
Date: Mon May 26 17:00:40 2014 +0200
Check for local file name clash before local renaming.
Return a proper error message in case.
---
src/mirall/propagatorjobs.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/mirall/propagatorjobs.cpp b/src/mirall/propagatorjobs.cpp
index d6455f3..f613e7e 100644
--- a/src/mirall/propagatorjobs.cpp
+++ b/src/mirall/propagatorjobs.cpp
@@ -182,6 +182,14 @@ void PropagateLocalRename::start()
emit progress(_item, 0);
qDebug() << "MOVE " << _propagator->_localDir + _item._file << " => " << _propagator->_localDir + _item._renameTarget;
QFile file(_propagator->_localDir + _item._file);
+
+ if (_propagator->localFileNameClash(_item._renameTarget)) {
+ // Fixme: the file that is the reason for the clash could be named here,
+ // it would have to come out the localFileNameClash function
+ done(SyncFileItem::NormalError, tr( "File %1 can not be renamed to %2 because of a local file name clash")
+ .arg(_item._file).arg(_item._renameTarget) );
+ return;
+ }
if (!file.rename(_propagator->_localDir + _item._file, _propagator->_localDir + _item._renameTarget)) {
done(SyncFileItem::NormalError, file.errorString());
return;
--
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