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

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-11-19 17:35:32 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2018-11-19 17:35:32 +0300
commit6cc496633fe09f0e51848412886d5048553ad193 (patch)
tree1318d2d71c54cf218ec110bfa2b22a16b3aad7e9 /src
parenta3d1bd3a4249cbceaad1b9190691e8ed469f48db (diff)
Do not read system exclude list if user exclude is present
For #566 Since we only showed the user exclude list (and some extra items) the system exclude list was still used. This copies over the system exclude list (if it isn't there). If it fails we use the system one still. However if you now remove items from your own list it will really be gone. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'src')
-rw-r--r--src/libsync/configfile.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp
index c94cb7c9f..5fb2ef10f 100644
--- a/src/libsync/configfile.cpp
+++ b/src/libsync/configfile.cpp
@@ -842,11 +842,19 @@ void ConfigFile::setupDefaultExcludeFilePaths(ExcludedFiles &excludedFiles)
{
ConfigFile cfg;
QString systemList = cfg.excludeFile(ConfigFile::SystemScope);
- qCInfo(lcConfigFile) << "Adding system ignore list to csync:" << systemList;
- excludedFiles.addExcludeFilePath(systemList);
-
QString userList = cfg.excludeFile(ConfigFile::UserScope);
- if (QFile::exists(userList)) {
+
+ if (!QFile::exists(userList)) {
+ qCInfo(lcConfigFile) << "User defined ignore list does not exist:" << userList;
+ if (!QFile::copy(systemList, userList)) {
+ qCInfo(lcConfigFile) << "Could not copy over default list to:" << userList;
+ }
+ }
+
+ if (!QFile::exists(userList)) {
+ qCInfo(lcConfigFile) << "Adding system ignore list to csync:" << systemList;
+ excludedFiles.addExcludeFilePath(systemList);
+ } else {
qCInfo(lcConfigFile) << "Adding user defined ignore list to csync:" << userList;
excludedFiles.addExcludeFilePath(userList);
}