[Pkg-owncloud-commits] [owncloud-client] 50/78: Undo regression caused by 727e73d

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Jun 24 16:29:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit a2b238e2e52c0006554e64973c84b5e01d7ae8b0
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Fri May 27 16:03:59 2016 +0200

    Undo regression caused by 727e73d
    
    normalization to NFC is still required. Mac OS API will not take
    care of that by default.
    
    Resolves #4884
---
 src/libsync/syncfilestatustracker.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/libsync/syncfilestatustracker.cpp b/src/libsync/syncfilestatustracker.cpp
index c083bd4..d63b79d 100644
--- a/src/libsync/syncfilestatustracker.cpp
+++ b/src/libsync/syncfilestatustracker.cpp
@@ -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());
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list