[Pkg-owncloud-commits] [owncloud-client] 17/27: Propagator: Fix local file name clash detection.

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Jul 29 16:23:59 UTC 2014


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 d4de024f15387da023ded98461f2e8e9c4879688
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Jul 23 17:54:12 2014 +0200

    Propagator: Fix local file name clash detection.
    
    Need to normalize the output of QFileInfo::canonicalFilePath() before
    comparing to a server side path.
    See https://bugreports.qt-project.org/browse/QTBUG-39622
    
    This fixes #1998 and #1999
---
 doc/ocdoc                         | 2 +-
 src/mirall/owncloudpropagator.cpp | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/ocdoc b/doc/ocdoc
index 2c3e584..c612df3 160000
--- a/doc/ocdoc
+++ b/doc/ocdoc
@@ -1 +1 @@
-Subproject commit 2c3e584b2356dc4324e6e0720b7aa908aaa480a3
+Subproject commit c612df399e3c775a2f9db1dc5e39d25920ab467b
diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index b8295cf..e32ea3e 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -337,8 +337,15 @@ bool OwncloudPropagator::localFileNameClash( const QString& relFile )
         QFileInfo fileInfo(file);
         if (!fileInfo.exists()) {
             re = false;
+            qDebug() << Q_FUNC_INFO << "No valid fileinfo";
         } else {
-            re = ( ! fileInfo.canonicalFilePath().endsWith(relFile, Qt::CaseSensitive) );
+            // Need to normalize to composited form because of
+            // https://bugreports.qt-project.org/browse/QTBUG-39622
+            const QString cName = fileInfo.canonicalFilePath().normalized(QString::NormalizationForm_C);
+            // qDebug() << Q_FUNC_INFO << "comparing " << cName << " with " << file;
+            bool equal = (file == cName);
+            re = (!equal && ! cName.endsWith(relFile, Qt::CaseSensitive) );
+            // qDebug() << Q_FUNC_INFO << "Returning for localFileNameClash: " << re;
         }
 #elif defined(Q_OS_WIN)
         const QString file( _localDir + relFile );

-- 
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