From ad276a4bce43bb09658043e11141eba10ccda032 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 20 Feb 2018 12:27:10 +0100 Subject: [PATCH] Folder: normalize the local path. We otherwise normalize all path in the C form, so we must have the Folder's path normalized the same. Or all comparizon will fail (such as knowing if a file from the SocketAPI or the FilesystemWatcher are part of the folder) Issue #4424 --- src/gui/folder.cpp | 4 ++++ src/libsync/owncloudpropagator.cpp | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 81a782db1..389213b70 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -119,6 +119,10 @@ void Folder::checkLocalPath() { const QFileInfo fi(_definition.localPath); _canonicalLocalPath = fi.canonicalFilePath(); +#ifdef Q_OS_MAC + // Workaround QTBUG-55896 (Should be fixed in Qt 5.8) + _canonicalLocalPath = _canonicalLocalPath.normalized(QString::NormalizationForm_C); +#endif if (_canonicalLocalPath.isEmpty()) { qCWarning(lcFolder) << "Broken symlink:" << _definition.localPath; _canonicalLocalPath = _definition.localPath; diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index 1604898a1..6708c17a4 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -588,8 +588,7 @@ bool OwncloudPropagator::localFileNameClash(const QString &relFile) re = false; qCWarning(lcPropagator) << "No valid fileinfo"; } else { - // Need to normalize to composited form because of - // https://bugreports.qt-project.org/browse/QTBUG-39622 + // Need to normalize to composited form because of QTBUG-39622/QTBUG-55896 const QString cName = fileInfo.canonicalFilePath().normalized(QString::NormalizationForm_C); bool equal = (file == cName); re = (!equal && !cName.endsWith(relFile, Qt::CaseSensitive));