SyncFileStatus SyncFileStatusTracker::fileStatus(const QString& relativePath)
{
- Q_ASSERT(!relativePath.endsWith(QLatin1Char('/')));
+ // normalization is required for OS X to match file names properly
+ QString normalizedRelativePath = relativePath.normalized(QString::NormalizationForm_C);
+ Q_ASSERT(!normalizedRelativePath.endsWith(QLatin1Char('/')));
- if (relativePath.isEmpty()) {
+ if (normalizedRelativePath.isEmpty()) {
// This is the root sync folder, it doesn't have an entry in the database and won't be walked by csync, so create one manually.
return syncFileItemStatus(rootSyncFileItem());
}
// update the exclude list at runtime and doing it statically here removes
// our ability to notify changes through the fileStatusChanged signal,
// it's an acceptable compromize to treat all exclude types the same.
- if( _syncEngine->excludedFiles().isExcluded(_syncEngine->localPath() + relativePath,
+ if( _syncEngine->excludedFiles().isExcluded(_syncEngine->localPath() + normalizedRelativePath,
_syncEngine->localPath(),
_syncEngine->ignoreHiddenFiles()) ) {
return SyncFileStatus(SyncFileStatus::StatusWarning);
}
- if ( _dirtyPaths.contains(relativePath) )
+ if ( _dirtyPaths.contains(normalizedRelativePath) )
return SyncFileStatus::StatusSync;
- SyncFileItem* item = _syncEngine->findSyncItem(relativePath);
+ SyncFileItem* item = _syncEngine->findSyncItem(normalizedRelativePath);
if (item) {
return syncFileItemStatus(*item);
}
// If we're not currently syncing that file, look it up in the database to know if it's shared
- SyncJournalFileRecord rec = _syncEngine->journal()->getFileRecord(relativePath);
+ SyncJournalFileRecord rec = _syncEngine->journal()->getFileRecord(normalizedRelativePath);
if (rec.isValid()) {
return syncFileItemStatus(rec.toSyncFileItem());
}