Read the blacklist entries case insensitive in case the file

system is only case preserving.
This commit is contained in:
Klaas Freitag 2014-05-23 16:00:51 +02:00
parent ef0a3c212e
commit ea9f302b7a
2 changed files with 10 additions and 2 deletions

View file

@ -132,7 +132,7 @@ void PropagateLocalMkdir::start()
QDir newDir(_propagator->_localDir + _item._file); QDir newDir(_propagator->_localDir + _item._file);
QString newDirStr = QDir::toNativeSeparators(newDir.path()); 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!"; qDebug() << "WARN: new directory to create locally already exists!";
done( SyncFileItem::NormalError, tr("Attention, possible case sensitivity clash with %1").arg(newDirStr) ); done( SyncFileItem::NormalError, tr("Attention, possible case sensitivity clash with %1").arg(newDirStr) );
return; return;

View file

@ -770,7 +770,15 @@ void SyncJournalDb::updateBlacklistEntry( const SyncJournalBlacklistRecord& item
return; 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); query.bindValue(":path", item._file);
if( !query.exec() ) { if( !query.exec() ) {