From abb1f89119bd25e887cf8a8b769423c07d0fbf95 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 20 Aug 2024 22:01:34 +0800 Subject: [PATCH] When forbidden filename sync warning is encountered, add reason why the filename is forbidden to the item's error string Signed-off-by: Claudio Cambra --- src/libsync/discovery.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index a2c00fb29cc9a..089717f621684 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -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; }