[Pkg-owncloud-commits] [owncloud-client] 92/159: owncloudcmd: Filter out empty lines in selectivesync

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri May 1 13:05:29 UTC 2015


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 7b99877c68c9ebedd5bd1bceece415e9cd64bd56
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Sun Apr 12 12:59:25 2015 +0200

    owncloudcmd: Filter out empty lines in selectivesync
---
 src/cmd/cmd.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp
index 0b8636b..55d924b 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('/'));

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