[Pkg-owncloud-commits] [owncloud-client] 456/498: Selective sync: on the first sync, do not ask confirmation for every folders
Sandro Knauß
hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:17 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 952c24903936586e2bd17e056d71b17ac2eb7957
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Wed Aug 5 16:11:59 2015 +0200
Selective sync: on the first sync, do not ask confirmation for every folders
Since we already confirmed a previous selective sync dialog
---
src/gui/accountsettings.cpp | 4 ++++
src/gui/owncloudsetupwizard.cpp | 3 +++
src/libsync/discoveryphase.cpp | 6 ++++++
3 files changed, 13 insertions(+)
diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index f11b87c..1872bca 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -228,6 +228,10 @@ void AccountSettings::slotFolderWizardAccepted()
Folder *f = folderMan->addFolder(_accountState, definition);
if( f ) {
f->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, selectiveSyncBlackList);
+
+ // The user already accepted the selective sync dialog. everything is in the white list
+ f->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList,
+ QStringList() << QLatin1String("/"));
folderMan->slotScheduleAllFolders();
emit folderChanged();
}
diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp
index b90cb79..151cf8e 100644
--- a/src/gui/owncloudsetupwizard.cpp
+++ b/src/gui/owncloudsetupwizard.cpp
@@ -474,6 +474,9 @@ void OwncloudSetupWizard::slotAssistantFinished( int result )
if (f) {
f->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList,
_ocWizard->selectiveSyncBlacklist());
+ // The user already accepted the selective sync dialog. everything is in the white list
+ f->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList,
+ QStringList() << QLatin1String("/"));
}
_ocWizard->appendToConfigurationLog(tr("<font color=\"green\"><b>Local sync folder %1 successfully created!</b></font>").arg(localFolder));
}
diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp
index 9f85978..07b0179 100644
--- a/src/libsync/discoveryphase.cpp
+++ b/src/libsync/discoveryphase.cpp
@@ -27,6 +27,12 @@ namespace OCC {
static bool findPathInList(const QStringList &list, const QString &path)
{
Q_ASSERT(std::is_sorted(list.begin(), list.end()));
+
+ if (list.size() == 1 && list.first() == QLatin1String("/")) {
+ // Special case for the case "/" is there, it matches everything
+ return true;
+ }
+
QString pathSlash = path + QLatin1Char('/');
// Since the list is sorted, we can do a binary search.
--
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