Skip to content

Commit

Permalink
When forbidden filename sync warning is encountered, add reason why t…
Browse files Browse the repository at this point in the history
…he filename is forbidden to the item's error string

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Aug 20, 2024
1 parent be67f27 commit 83bb1ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,18 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent
break;
case CSYNC_FILE_EXCLUDE_SERVER_BLACKLISTED:
item->_errorString = tr("The filename is blacklisted on the server.");
if (hasForbiddenFilename) {
item->_errorString += tr(" Reason: the entire filename is forbidden.");
}
if (hasForbiddenBasename) {
item->_errorString += tr(" Reason: the filename has a forbidden base name (filename start).");
}
if (hasForbiddenExtension) {
item->_errorString += tr(" Reason: the file has a forbidden extension (.%1).").arg(extension);
}
if (containsForbiddenCharacters) {
item->_errorString += tr(" Reason: the filename contains a forbidden character (%1).").arg(forbiddenCharMatch);
}
item->_status = SyncFileItem::FileNameInvalidOnServer;
break;
}
Expand Down

0 comments on commit 83bb1ed

Please sign in to comment.