mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Do not propagate a move of the Shared folder.
This commit is contained in:
parent
a06e551469
commit
660469cbf5
@ -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<char, QScopedPointerPodDeleter> uri1(ne_path_escape((_remoteDir + item._file).toUtf8()));
|
||||
QScopedPointer<char, QScopedPointerPodDeleter> 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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user