[Pkg-owncloud-commits] [owncloud-client] 23/83: Add a utility function fsCasePreserving.

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 ef0a3c212ed14772a9b09e1b6129c66d6c1de0f8
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Fri May 23 15:59:29 2014 +0200

    Add a utility function fsCasePreserving.
    
    Returns true if the underlying file system is case preserving instead
    of case sensitive. That is true for Mac and Windows currently. Only
    Linux has a case sensitive file system usually.
---
 src/mirall/utility.cpp | 9 +++++++++
 src/mirall/utility.h   | 6 ++++++
 2 files changed, 15 insertions(+)

diff --git a/src/mirall/utility.cpp b/src/mirall/utility.cpp
index 3453c4b..9664534 100644
--- a/src/mirall/utility.cpp
+++ b/src/mirall/utility.cpp
@@ -348,6 +348,15 @@ static bool checkDolphinCanSelect()
     return p.readAll().contains("--select");
 }
 
+bool Utility::fsCasePreserving()
+{
+    bool re = false;
+    if( isWindows() || isMac() ) {
+        re = true;
+    }
+    return re;
+}
+
 // inspired by Qt Creator's showInGraphicalShell();
 void Utility::showInFileManager(const QString &localPath)
 {
diff --git a/src/mirall/utility.h b/src/mirall/utility.h
index ca72f36..c893001 100644
--- a/src/mirall/utility.h
+++ b/src/mirall/utility.h
@@ -69,6 +69,12 @@ namespace Utility
     OWNCLOUDSYNC_EXPORT bool isUnix();
     OWNCLOUDSYNC_EXPORT bool isLinux(); // use with care
 
+    // Case preserving file system underneath?
+    // if this function returns true, the file system is case preserving,
+    // that means "test" means the same as "TEST" for filenames.
+    // if false, the two cases are two different files.
+    OWNCLOUDSYNC_EXPORT bool fsCasePreserving();
+
     class StopWatch {
     private:
         QHash<QString, quint64> _lapTimes;

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