Просмотр исходного кода

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.
Christian Kamm 11 лет назад
Родитель
Сommit
aef569ee9d
2 измененных файлов с 9 добавлено и 0 удалено
  1. 1 0
      CMakeLists.txt
  2. 8 0
      src/mirall/mirallconfigfile.cpp

+ 1 - 0
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()

+ 8 - 0
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