From ea9f302b7aa462e2c14662308a762ead659ab773 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Fri, 23 May 2014 16:00:51 +0200 Subject: [PATCH] Read the blacklist entries case insensitive in case the file system is only case preserving. --- src/mirall/propagatorjobs.cpp | 2 +- src/mirall/syncjournaldb.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mirall/propagatorjobs.cpp b/src/mirall/propagatorjobs.cpp index 6fab6a543..72cc7ad75 100644 --- a/src/mirall/propagatorjobs.cpp +++ b/src/mirall/propagatorjobs.cpp @@ -132,7 +132,7 @@ void PropagateLocalMkdir::start() QDir newDir(_propagator->_localDir + _item._file); QString newDirStr = QDir::toNativeSeparators(newDir.path()); - if(newDir.exists() && hasCaseClash(_propagator->_localDir + _item._file ) ) { // add a check on the file name + if( Utility::fsCasePreserving() && newDir.exists() && hasCaseClash(_propagator->_localDir + _item._file ) ) { // add a check on the file name qDebug() << "WARN: new directory to create locally already exists!"; done( SyncFileItem::NormalError, tr("Attention, possible case sensitivity clash with %1").arg(newDirStr) ); return; diff --git a/src/mirall/syncjournaldb.cpp b/src/mirall/syncjournaldb.cpp index fe691eb3c..90d075334 100644 --- a/src/mirall/syncjournaldb.cpp +++ b/src/mirall/syncjournaldb.cpp @@ -770,7 +770,15 @@ void SyncJournalDb::updateBlacklistEntry( const SyncJournalBlacklistRecord& item return; } - query.prepare("SELECT retrycount FROM blacklist WHERE path=:path"); + QString sql("SELECT retrycount FROM blacklist WHERE path=:path"); + + if( Utility::fsCasePreserving() ) { + // if the file system is case preserving we have to check the blacklist + // case insensitively + sql += QLatin1String(" COLLATE NOCASE"); + } + + query.prepare(sql); query.bindValue(":path", item._file); if( !query.exec() ) {