Bring back the error message if the sync-exclude.lst file is missing
authorJocelyn Turcotte <jturcotte@woboq.com>
Tue, 24 Jan 2017 16:57:52 +0000 (17:57 +0100)
committerJocelyn Turcotte <jturcotte@woboq.com>
Wed, 25 Jan 2017 22:26:23 +0000 (23:26 +0100)
We unconditionnally add the file on startup, but don't check for errors.
During sync we check for errors, but only try loading the file if it
exists.

src/gui/folder.cpp

index 24ed2cc1c6adae3fb3b5d89de5ab864c7044ebfa..570bac6e625dfd3d2f6ca52c916efacbc1ef48f7 100644 (file)
@@ -692,10 +692,9 @@ bool Folder::setIgnoredFiles()
     // a QSet of files to load.
     ConfigFile cfg;
     QString systemList = cfg.excludeFile(ConfigFile::SystemScope);
-    if( QFile::exists(systemList) ) {
-        qDebug() << "==== adding system ignore list to csync:" << systemList;
-        _engine->excludedFiles().addExcludeFilePath(systemList);
-    }
+    qDebug() << "==== adding system ignore list to csync:" << systemList;
+    _engine->excludedFiles().addExcludeFilePath(systemList);
+
     QString userList = cfg.excludeFile(ConfigFile::UserScope);
     if( QFile::exists(userList) ) {
         qDebug() << "==== adding user defined ignore list to csync:" << userList;
@@ -739,6 +738,8 @@ void Folder::startSync(const QStringList &pathList)
     qDebug() << "*** Start syncing " << remoteUrl().toString() << " - client version"
              << qPrintable(Theme::instance()->version());
 
+    _fileLog->start(path());
+
     if (!setIgnoredFiles())
     {
         slotSyncError(tr("Could not read system exclude file"));
@@ -755,8 +756,6 @@ void Folder::startSync(const QStringList &pathList)
 
     _engine->setIgnoreHiddenFiles(_definition.ignoreHiddenFiles);
 
-    _fileLog->start(path());
-
     QMetaObject::invokeMethod(_engine.data(), "startSync", Qt::QueuedConnection);
 
     emit syncStarted();