[Pkg-owncloud-commits] [owncloud-client] 21/83: More progress on the CI problem detection.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat May 31 11:31:39 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 7e8b4031160028db86ee710e2b07b3f67d15fe69
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Thu May 22 17:12:59 2014 +0200

    More progress on the CI problem detection.
---
 src/mirall/propagatorjobs.cpp | 28 +++++++++++++++++++++++++++-
 src/mirall/propagatorjobs.h   |  1 +
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/mirall/propagatorjobs.cpp b/src/mirall/propagatorjobs.cpp
index 42ed45d..6fab6a5 100644
--- a/src/mirall/propagatorjobs.cpp
+++ b/src/mirall/propagatorjobs.cpp
@@ -99,6 +99,32 @@ void PropagateLocalRemove::start()
     done(SyncFileItem::Success);
 }
 
+bool PropagateLocalMkdir::hasCaseClash( const QString& file )
+{
+    bool re = false;
+
+    qDebug() << "CaseClashCheck for " << file;
+#ifdef Q_OS_WIN
+    WIN32_FIND_DATA FindFileData;
+    HANDLE hFind;
+
+    hFind = FindFirstFileW( (wchar_t*)file.utf16(), &FindFileData);
+    if (hFind == INVALID_HANDLE_VALUE) {
+       qDebug() << "FindFirstFile failed " << GetLastError();
+       // returns false.
+    } else {
+       QString realFileName = QString::fromWCharArray( FindFileData.cFileName );
+       qDebug() << Q_FUNC_INFO << "Real file name is " << realFileName;
+       FindClose(hFind);
+
+       if( ! file.endsWith(realFileName, Qt::CaseSensitive) ) {
+           re = true;
+       }
+    }
+#endif
+    return re;
+}
+
 void PropagateLocalMkdir::start()
 {
     if (_propagator->_abortRequested.fetchAndAddRelaxed(0))
@@ -106,7 +132,7 @@ void PropagateLocalMkdir::start()
 
     QDir newDir(_propagator->_localDir + _item._file);
     QString newDirStr = QDir::toNativeSeparators(newDir.path());
-    if(newDir.exists()) {
+    if(newDir.exists() && hasCaseClash(_propagator->_localDir + _item._file ) ) { // add a check on the file name
         qDebug() << "WARN: new directory to create locally already exists!";
         done( SyncFileItem::NormalError, tr("Attention, possible case sensitivity clash with %1").arg(newDirStr) );
         return;
diff --git a/src/mirall/propagatorjobs.h b/src/mirall/propagatorjobs.h
index 3b77e24..c256c05 100644
--- a/src/mirall/propagatorjobs.h
+++ b/src/mirall/propagatorjobs.h
@@ -81,6 +81,7 @@ class PropagateLocalMkdir : public PropagateItemJob {
 public:
     PropagateLocalMkdir (OwncloudPropagator* propagator,const SyncFileItem& item)  : PropagateItemJob(propagator, item) {}
     void start();
+    bool hasCaseClash( const QString& file );
 };
 class PropagateRemoteRemove : public PropagateNeonJob {
     Q_OBJECT

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