Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorClaudio Cambra <claudio.cambra@gmail.com>2022-09-21 20:13:54 +0300
committerClaudio Cambra <claudio.cambra@gmail.com>2022-09-26 13:10:38 +0300
commit6fa2542a10926d6e6cde33b29a6ef524a5395f27 (patch)
tree69ea4e8a922012530317ebb5d2940073e5155ca6 /src
parent38bc1e271818e53822d5a089b88b0447473973c8 (diff)
Categorise file name clash sync file issues as separate FileNameClash enum treated as warning
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/tray/activitylistmodel.cpp3
-rw-r--r--src/libsync/bulkpropagatorjob.cpp1
-rw-r--r--src/libsync/owncloudpropagator.cpp1
-rw-r--r--src/libsync/progressdispatcher.cpp3
-rw-r--r--src/libsync/propagatedownload.cpp8
-rw-r--r--src/libsync/syncfileitem.h6
-rw-r--r--src/libsync/syncresult.cpp2
7 files changed, 17 insertions, 7 deletions
diff --git a/src/gui/tray/activitylistmodel.cpp b/src/gui/tray/activitylistmodel.cpp
index b94d5bfd8..a840143a6 100644
--- a/src/gui/tray/activitylistmodel.cpp
+++ b/src/gui/tray/activitylistmodel.cpp
@@ -232,7 +232,8 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
|| a._status == SyncFileItem::Conflict
|| a._status == SyncFileItem::Restoration
|| a._status == SyncFileItem::FileLocked
- || a._status == SyncFileItem::FileNameInvalid) {
+ || a._status == SyncFileItem::FileNameInvalid
+ || a._status == SyncFileItem::FileNameClash) {
colorIconPath.append("state-warning.svg");
return colorIconPath;
} else if (a._status == SyncFileItem::FileIgnored) {
diff --git a/src/libsync/bulkpropagatorjob.cpp b/src/libsync/bulkpropagatorjob.cpp
index 6d4074168..228180711 100644
--- a/src/libsync/bulkpropagatorjob.cpp
+++ b/src/libsync/bulkpropagatorjob.cpp
@@ -711,6 +711,7 @@ void BulkPropagatorJob::handleJobDoneErrors(SyncFileItemPtr item,
case SyncFileItem::FileIgnored:
case SyncFileItem::FileLocked:
case SyncFileItem::FileNameInvalid:
+ case SyncFileItem::FileNameClash:
case SyncFileItem::NoStatus:
case SyncFileItem::NormalError:
case SyncFileItem::Restoration:
diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp
index aba3f437f..428d82d90 100644
--- a/src/libsync/owncloudpropagator.cpp
+++ b/src/libsync/owncloudpropagator.cpp
@@ -273,6 +273,7 @@ void PropagateItemJob::done(SyncFileItem::Status statusArg, const QString &error
case SyncFileItem::BlacklistedError:
case SyncFileItem::FileLocked:
case SyncFileItem::FileNameInvalid:
+ case SyncFileItem::FileNameClash:
// nothing
break;
}
diff --git a/src/libsync/progressdispatcher.cpp b/src/libsync/progressdispatcher.cpp
index 45c5beac4..8daf74b46 100644
--- a/src/libsync/progressdispatcher.cpp
+++ b/src/libsync/progressdispatcher.cpp
@@ -97,7 +97,8 @@ bool Progress::isWarningKind(SyncFileItem::Status kind)
|| kind == SyncFileItem::FatalError || kind == SyncFileItem::FileIgnored
|| kind == SyncFileItem::Conflict || kind == SyncFileItem::Restoration
|| kind == SyncFileItem::DetailError || kind == SyncFileItem::BlacklistedError
- || kind == SyncFileItem::FileLocked;
+ || kind == SyncFileItem::FileLocked || kind == SyncFileItem::FileNameInvalid
+ || kind == SyncFileItem::FileNameClash;
}
bool Progress::isIgnoredKind(SyncFileItem::Status kind)
diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp
index 088ce7289..0bb179b81 100644
--- a/src/libsync/propagatedownload.cpp
+++ b/src/libsync/propagatedownload.cpp
@@ -528,14 +528,14 @@ void PropagateDownloadFile::startAfterIsEncryptedIsChecked()
}
if (_item->_type == ItemTypeVirtualFile) {
if (propagator()->localFileNameClash(_item->_file)) {
- done(SyncFileItem::NormalError, tr("File %1 cannot be downloaded because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
+ done(SyncFileItem::FileNameClash, tr("File %1 cannot be downloaded because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
return;
}
qCDebug(lcPropagateDownload) << "creating virtual file" << _item->_file;
// do a klaas' case clash check.
if (propagator()->localFileNameClash(_item->_file)) {
- done(SyncFileItem::NormalError, tr("File %1 can not be downloaded because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
+ done(SyncFileItem::FileNameClash, tr("File %1 can not be downloaded because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
return;
}
auto r = vfs->createPlaceholder(*_item);
@@ -633,7 +633,7 @@ void PropagateDownloadFile::startDownload()
// do a klaas' case clash check.
if (propagator()->localFileNameClash(_item->_file)) {
- done(SyncFileItem::NormalError, tr("File %1 cannot be downloaded because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
+ done(SyncFileItem::FileNameClash, tr("File %1 cannot be downloaded because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
return;
}
@@ -1126,7 +1126,7 @@ void PropagateDownloadFile::downloadFinished()
// In case of file name clash, report an error
// This can happen if another parallel download saved a clashing file.
if (propagator()->localFileNameClash(_item->_file)) {
- done(SyncFileItem::NormalError, tr("File %1 cannot be saved because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
+ done(SyncFileItem::FileNameClash, tr("File %1 cannot be saved because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
return;
}
diff --git a/src/libsync/syncfileitem.h b/src/libsync/syncfileitem.h
index 9dc6fa4f5..9668e3ff6 100644
--- a/src/libsync/syncfileitem.h
+++ b/src/libsync/syncfileitem.h
@@ -71,6 +71,12 @@ public:
*/
FileNameInvalid,
+ /**
+ * There is a file name clash (e.g. attempting to download test.txt when TEST.TXT already exists
+ * on a platform where the filesystem is case-insensitive
+ */
+ FileNameClash,
+
/** For errors that should only appear in the error view.
*
* Some errors also produce a summary message. Usually displaying that message is
diff --git a/src/libsync/syncresult.cpp b/src/libsync/syncresult.cpp
index e7aa3ab54..3dede8661 100644
--- a/src/libsync/syncresult.cpp
+++ b/src/libsync/syncresult.cpp
@@ -141,7 +141,7 @@ void SyncResult::processCompletedItem(const SyncFileItemPtr &item)
if (!_firstItemError) {
_firstItemError = item;
}
- } else if (item->_status == SyncFileItem::Conflict || item->_status == SyncFileItem::FileNameInvalid) {
+ } else if (item->_status == SyncFileItem::Conflict || item->_status == SyncFileItem::FileNameInvalid || item->_status == SyncFileItem::FileNameClash) {
if (item->_instruction == CSYNC_INSTRUCTION_CONFLICT) {
_numNewConflictItems++;
if (!_firstNewConflictItem) {