[Pkg-owncloud-commits] [owncloud-client] 07/120: Selective sync: When applying selective sync, put new folder that were just checked in the white list
Sandro Knauß
hefee-guest at moszumanska.debian.org
Mon Aug 24 00:02:36 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 ae7b2509a5bcc638b213d560ba4943aaebf6236a
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Fri Aug 7 13:36:10 2015 +0200
Selective sync: When applying selective sync, put new folder that were just checked in the white list
Issue #3560
Otherwise the just checked folder will be chacked again for their size.
We do not want that.
---
src/gui/folderstatusmodel.cpp | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 9c32c7d..4943c60 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -566,13 +566,14 @@ void FolderStatusModel::slotApplySelectiveSync()
QStringList blackList = createBlackList(&_folders[i], oldBlackList);
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blackList);
- // The folders that were undecided should be part of the white list if they are not in the blacklist
- QStringList toAddToWhiteList;
- foreach (const auto &undec, folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList)) {
- if (!blackList.contains(undec)) {
- toAddToWhiteList.append(undec);
- }
- }
+ auto blackListSet = blackList.toSet();
+ auto oldBlackListSet = oldBlackList.toSet();
+
+ // The folders that were undecided or blacklisted and that are now checked should go on the white list.
+ // The user confirmed them already just now.
+ QStringList toAddToWhiteList = ((oldBlackListSet + folder->journalDb()->getSelectiveSyncList(
+ SyncJournalDb::SelectiveSyncUndecidedList).toSet()) - blackListSet).toList();
+
if (!toAddToWhiteList.isEmpty()) {
auto whiteList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList);
whiteList += toAddToWhiteList;
@@ -582,8 +583,6 @@ void FolderStatusModel::slotApplySelectiveSync()
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, QStringList());
// do the sync if there was changes
- auto blackListSet = blackList.toSet();
- auto oldBlackListSet = oldBlackList.toSet();
auto changes = (oldBlackListSet - blackListSet) + (blackListSet - oldBlackListSet);
if (!changes.isEmpty()) {
if (folder->isBusy()) {
--
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