Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Goetz <markus@woboq.com>2014-10-17 17:58:01 +0400
committerMarkus Goetz <markus@woboq.com>2014-10-17 17:58:01 +0400
commitf1006ca8b092dde63d7c870b2dd18ce34283288e (patch)
tree253c6fb2a60432b80247c6cb8ba4ef3fc655b221 /src/owncloudcmd
parent93c85711d19e2e29975d5fa7b3b8afad317cba22 (diff)
owncloudcmd: Always need exclude list
Try to load the system list or the user supplied list. For #2322
Diffstat (limited to 'src/owncloudcmd')
-rw-r--r--src/owncloudcmd/owncloudcmd.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/owncloudcmd/owncloudcmd.cpp b/src/owncloudcmd/owncloudcmd.cpp
index f6bfbb2f5..9ac7e3a0b 100644
--- a/src/owncloudcmd/owncloudcmd.cpp
+++ b/src/owncloudcmd/owncloudcmd.cpp
@@ -27,6 +27,7 @@
#include "csync.h"
#include "mirall/clientproxy.h"
#include "mirall/account.h"
+#include "mirall/mirallconfigfile.h" // ONLY ACCESS THE STATIC FUNCTIONS!
#include "creds/httpcredentials.h"
#include "owncloudcmd.h"
#include "simplesslerrorhandler.h"
@@ -374,8 +375,22 @@ restart_sync:
clientProxy.setCSyncProxy(QUrl(url), _csync_ctx);
}
+ // Exclude lists
+ QString systemExcludeListFn = MirallConfigFile::excludeFileFromSystem();
+ int loadedSystemExcludeList = false;
+ if (!systemExcludeListFn.isEmpty()) {
+ loadedSystemExcludeList = csync_add_exclude_list(_csync_ctx, systemExcludeListFn.toLocal8Bit());
+ }
+
+ int loadedUserExcludeList = false;
if (!options.exclude.isEmpty()) {
- csync_add_exclude_list(_csync_ctx, options.exclude.toLocal8Bit());
+ loadedUserExcludeList = csync_add_exclude_list(_csync_ctx, options.exclude.toLocal8Bit());
+ }
+
+ if (loadedSystemExcludeList != 0 && loadedUserExcludeList != 0) {
+ // Always make sure at least one list had been loaded
+ qFatal("Cannot load system exclude list or list supplied via --exclude");
+ return EXIT_FAILURE;
}
cred->syncContextPreStart(_csync_ctx);