Skip to content

Commit

Permalink
Bogus.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Jul 5, 2024
1 parent 47349c1 commit 37ddeae
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent

const auto fileName = path.mid(path.lastIndexOf('/') + 1);

if (excluded == CSYNC_NOT_EXCLUDED && Utility::isWindows()) {
// we don't need to trigger a warning if trailing/leading space file is already on the server or has already been synced down
// only if the OS supports trailing/leading spaces
const auto osSupportsSpaces = !Utility::isWindows();
const auto wasSyncedAlready = (entries.dbEntry.isValid() || entries.serverEntry.isValid());

if (excluded == CSYNC_NOT_EXCLUDED && (!osSupportsSpaces || !((osSupportsSpaces && wasSyncedAlready) || _discoveryData->_leadingAndTrailingSpacesFilesAllowed.contains(_discoveryData->_localDir + path)))) {
const auto endsWithSpace = fileName.endsWith(QLatin1Char(' '));
const auto startsWithSpace = fileName.startsWith(QLatin1Char(' '));
if (startsWithSpace && endsWithSpace) {
Expand All @@ -273,11 +278,11 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent

// we don't need to trigger a warning if trailing/leading space file is already on the server or has already been synced down
// only if the OS supports trailing/leading spaces
const auto wasSyncedAlreadyAndOsSupportsSpaces = !Utility::isWindows() && (entries.serverEntry.isValid() || entries.dbEntry.isValid());
if ((excluded == CSYNC_FILE_EXCLUDE_LEADING_SPACE || excluded == CSYNC_FILE_EXCLUDE_TRAILING_SPACE || excluded == CSYNC_FILE_EXCLUDE_LEADING_AND_TRAILING_SPACE)
&& (wasSyncedAlreadyAndOsSupportsSpaces || _discoveryData->_leadingAndTrailingSpacesFilesAllowed.contains(_discoveryData->_localDir + path))) {
excluded = CSYNC_NOT_EXCLUDED;
}
// const auto wasSyncedAlreadyAndOsSupportsSpaces = !Utility::isWindows() && (entries.serverEntry.isValid() || entries.dbEntry.isValid());
// if ((excluded == CSYNC_FILE_EXCLUDE_LEADING_SPACE || excluded == CSYNC_FILE_EXCLUDE_TRAILING_SPACE || excluded == CSYNC_FILE_EXCLUDE_LEADING_AND_TRAILING_SPACE)
// && (wasSyncedAlreadyAndOsSupportsSpaces || _discoveryData->_leadingAndTrailingSpacesFilesAllowed.contains(_discoveryData->_localDir + path))) {
// excluded = CSYNC_NOT_EXCLUDED;
// }

// FIXME: move to ExcludedFiles 's regexp ?
bool isInvalidPattern = false;
Expand Down

0 comments on commit 37ddeae

Please sign in to comment.