From 660469cbf5dff38dfd3ab5d7cf16f7c6805873f6 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 17 Oct 2013 10:48:24 +0200 Subject: [PATCH] Do not propagate a move of the Shared folder. --- src/mirall/owncloudpropagator.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp index 51fe1ffef2..8e461cf674 100644 --- a/src/mirall/owncloudpropagator.cpp +++ b/src/mirall/owncloudpropagator.cpp @@ -648,10 +648,20 @@ csync_instructions_e OwncloudPropagator::remoteRename(const SyncFileItem &item) _status = SyncFileItem::Success; return CSYNC_INSTRUCTION_DELETED; // nothing to do; } + + // Check if it is the toplevel Shared folder and do not propagate it. + if (item._file == QLatin1String("Shared") ) { + if( QFile::rename( _localDir + item._renameTarget, _localDir + QLatin1String("Shared")) ) { + _errorString = tr("This folder must not be renamed. It is renamed back to its original name."); + } else { + _errorString = tr("This folder must not be renamed. Please name it back to Shared."); + } + return CSYNC_INSTRUCTION_ERROR; + } + QScopedPointer uri1(ne_path_escape((_remoteDir + item._file).toUtf8())); QScopedPointer uri2(ne_path_escape((_remoteDir + item._renameTarget).toUtf8())); - int rc = ne_move(_session, 1, uri1.data(), uri2.data()); if (updateErrorFromSession(rc)) { return CSYNC_INSTRUCTION_ERROR;