[Pkg-owncloud-commits] [owncloud-client] 63/219: SyncEngine: Use exclude file fallback next to binary on linux.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:10 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 aef569ee9d35c7927df7ee142c7f9644ce47ca81
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Wed Sep 3 14:33:58 2014 +0200

    SyncEngine: Use exclude file fallback next to binary on linux.
    
    This is mainly useful for developers where the system-wide exclude file
    may not exist.
---
 CMakeLists.txt                  | 1 +
 src/mirall/mirallconfigfile.cpp | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f7be4fa..cdd27d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -161,4 +161,5 @@ if(BUILD_OWNCLOUD_OSX_BUNDLE)
     configure_file(sync-exclude.lst ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
 else()
     install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
+    configure_file(sync-exclude.lst bin/sync-exclude.lst COPYONLY)
 endif()
diff --git a/src/mirall/mirallconfigfile.cpp b/src/mirall/mirallconfigfile.cpp
index a791a06..f659302 100644
--- a/src/mirall/mirallconfigfile.cpp
+++ b/src/mirall/mirallconfigfile.cpp
@@ -233,6 +233,14 @@ QString MirallConfigFile::excludeFile(Scope scope) const
 #endif
 #ifdef Q_OS_UNIX
             fi.setFile( QString( SYSCONFDIR "/%1").arg(Theme::instance()->appName()), exclFile );
+            if ( ! fi.exists() )
+            {
+                // Prefer to return the preferred path! Only use the fallback location
+                // if the other path does not exist and the fallback is valid.
+                QFileInfo next_to_binary( QCoreApplication::applicationDirPath(), exclFile );
+                if (next_to_binary.exists())
+                    fi = next_to_binary;
+            }
 #endif
 #ifdef Q_OS_MAC
             // exec path is inside the bundle

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