OS X: Fix localFileNameClash

We need to compare the other way round and compare only the file name
because our sync directory might be symlinked and then resolve to
another canonical path (but we were only interested in the filename part
anyway)
This commit is contained in:
Markus Goetz 2014-05-30 15:46:51 +02:00
parent 064dcdb25a
commit 022a3fcd92

View file

@ -312,11 +312,11 @@ bool OwncloudPropagator::localFileNameClash( const QString& relFile )
if( !file.isEmpty() && Utility::fsCasePreserving() ) {
#ifdef Q_OS_MAC
QFileInfo fileInfo(file);
if (!fileInfo.exists())
if (!fileInfo.exists()) {
re = false;
else
re = ( ! file.endsWith(fileInfo.canonicalFilePath(), Qt::CaseSensitive) );
} else {
re = ( ! fileInfo.canonicalFilePath().endsWith(relFile, Qt::CaseSensitive) );
}
#elif defined(Q_OS_WIN)
const QString file( _localDir + relFile );
qDebug() << "CaseClashCheck for " << file;