mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 05:55:59 +03:00
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
This commit is contained in:
parent
5e2270bd57
commit
ad276a4bce
2 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue