Merge pull request #4913 from owncloud/normalize_name_in_filestatus

Undo regression caused by 727e73d
This commit is contained in:
Daniel Molkentin 2016-05-27 18:08:08 +02:00
commit 00d20b4a42

View file

@ -94,9 +94,11 @@ SyncFileItem SyncFileStatusTracker::rootSyncFileItem()
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());
}
@ -107,22 +109,22 @@ SyncFileStatus SyncFileStatusTracker::fileStatus(const QString& relativePath)
// 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());
}