@@ -261,6 +261,8 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent
261
261
262
262
const auto fileName = path.mid (path.lastIndexOf (' /' ) + 1 );
263
263
264
+ const auto isLocal = entries.localEntry .isValid ();
265
+
264
266
if (excluded == CSYNC_NOT_EXCLUDED) {
265
267
const auto endsWithSpace = fileName.endsWith (QLatin1Char (' ' ));
266
268
const auto startsWithSpace = fileName.startsWith (QLatin1Char (' ' ));
@@ -420,21 +422,21 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent
420
422
case CSYNC_FILE_EXCLUDE_TRAILING_SPACE:
421
423
item->_errorString = tr (" Filename contains trailing spaces." );
422
424
item->_status = SyncFileItem::FileNameInvalid;
423
- if (!maybeRenameForWindowsCompatibility (_discoveryData->_localDir + item->_file , excluded)) {
425
+ if (isLocal && !maybeRenameForWindowsCompatibility (_discoveryData->_localDir + item->_file , excluded)) {
424
426
item->_errorString += QStringLiteral (" %1" ).arg (tr (" Cannot be renamed or uploaded." ));
425
427
}
426
428
break ;
427
429
case CSYNC_FILE_EXCLUDE_LEADING_SPACE:
428
430
item->_errorString = tr (" Filename contains leading spaces." );
429
431
item->_status = SyncFileItem::FileNameInvalid;
430
- if (!maybeRenameForWindowsCompatibility (_discoveryData->_localDir + item->_file , excluded)) {
432
+ if (isLocal && !maybeRenameForWindowsCompatibility (_discoveryData->_localDir + item->_file , excluded)) {
431
433
item->_errorString += QStringLiteral (" %1" ).arg (tr (" Cannot be renamed or uploaded." ));
432
434
}
433
435
break ;
434
436
case CSYNC_FILE_EXCLUDE_LEADING_AND_TRAILING_SPACE:
435
437
item->_errorString = tr (" Filename contains leading and trailing spaces." );
436
438
item->_status = SyncFileItem::FileNameInvalid;
437
- if (!maybeRenameForWindowsCompatibility (_discoveryData->_localDir + item->_file , excluded)) {
439
+ if (isLocal && !maybeRenameForWindowsCompatibility (_discoveryData->_localDir + item->_file , excluded)) {
438
440
item->_errorString += QStringLiteral (" %1" ).arg (tr (" Cannot be renamed or uploaded." ));
439
441
}
440
442
break ;
@@ -476,7 +478,7 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent
476
478
}
477
479
item->_errorString = reasonString.isEmpty () ? errorString : QStringLiteral (" %1 %2" ).arg (errorString, reasonString);
478
480
item->_status = SyncFileItem::FileNameInvalidOnServer;
479
- if (!maybeRenameForWindowsCompatibility (_discoveryData->_localDir + item->_file , excluded)) {
481
+ if (isLocal && !maybeRenameForWindowsCompatibility (_discoveryData->_localDir + item->_file , excluded)) {
480
482
item->_errorString += QStringLiteral (" %1" ).arg (tr (" Cannot be renamed or uploaded." ));
481
483
}
482
484
break ;
0 commit comments