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
path: root/src
diff options
context:
space:
mode:
authorKlaas Freitag <freitag@owncloud.com>2015-04-12 13:59:25 +0300
committerKlaas Freitag <freitag@owncloud.com>2015-04-12 13:59:25 +0300
commit7b99877c68c9ebedd5bd1bceece415e9cd64bd56 (patch)
tree704d50830e2371d7954df24188809d975a38410d /src
parentec81cdefb0c133d2cc8f6fac27dad60b258bd430 (diff)
owncloudcmd: Filter out empty lines in selectivesync
Diffstat (limited to 'src')
-rw-r--r--src/cmd/cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp
index 0b8636bea..55d924b6e 100644
--- a/src/cmd/cmd.cpp
+++ b/src/cmd/cmd.cpp
@@ -445,7 +445,9 @@ restart_sync:
if (!f.open(QFile::ReadOnly)) {
qCritical() << "Could not open file containing the list of unsynced folders: " << options.unsyncedfolders;
} else {
- selectiveSyncList = QString::fromUtf8(f.readAll()).split('\n');
+ // filter out empty lines and comments
+ selectiveSyncList = QString::fromUtf8(f.readAll()).split('\n').filter(QRegExp("\\S+")).filter(QRegExp("^[^#]"));
+
for (int i = 0; i < selectiveSyncList.count(); ++i) {
if (!selectiveSyncList.at(i).endsWith(QLatin1Char('/'))) {
selectiveSyncList[i].append(QLatin1Char('/'));