From: Matthieu Gallien Date: Wed, 12 Feb 2025 22:02:57 +0000 (+0100) Subject: basically try to enforce the windows compatibility as guess from server X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~50^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=44df8fa926b2630a3b363766f49ff658d7531940;p=nextcloud-desktop.git basically try to enforce the windows compatibility as guess from server for now simple rule to guess if the server has windows naming enforced if windows naming is enforced, we enforce it for new files if not, we do not care for now limited to spaces removal more to come Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 646808147..aa6696810 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -290,7 +290,7 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent const auto hasLeadingOrTrailingSpaces = excluded == CSYNC_FILE_EXCLUDE_LEADING_SPACE || excluded == CSYNC_FILE_EXCLUDE_TRAILING_SPACE || excluded == CSYNC_FILE_EXCLUDE_LEADING_AND_TRAILING_SPACE; - const auto leadingAndTrailingSpacesFilesAllowed = _discoveryData->_leadingAndTrailingSpacesFilesAllowed.contains(_discoveryData->_localDir + path); + const auto leadingAndTrailingSpacesFilesAllowed = !_discoveryData->_shouldEnforceWindowsFileNameCompatibility || _discoveryData->_leadingAndTrailingSpacesFilesAllowed.contains(_discoveryData->_localDir + path); if (hasLeadingOrTrailingSpaces && (wasSyncedAlready || leadingAndTrailingSpacesFilesAllowed)) { excluded = CSYNC_NOT_EXCLUDED; } @@ -470,6 +470,7 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent } item->_errorString = reasonString.isEmpty() ? errorString : QStringLiteral("%1 %2").arg(errorString, reasonString); item->_status = SyncFileItem::FileNameInvalidOnServer; + maybeRenameForWindowsCompatibility(_discoveryData->_localDir + item->_file, excluded); break; } }