From 6f454feb391b2ef4f0f7bcf3416bb3b14469b3f4 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 12 Apr 2016 11:49:52 +0200 Subject: [PATCH] Fix hidden file handling #4655 There were two issues: * With the refactoring of how Folder and SyncEngine relate, the ignore_hidden_files flag on the CSync context was reset after each sync run and not updated from the configuration again. * The folder watcher failed to enumerate hidden folders and thus didn't watch for changes inside them. (linux only) --- csync/src/csync.c | 1 - src/gui/folder.cpp | 2 ++ src/gui/folderwatcher_linux.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/csync/src/csync.c b/csync/src/csync.c index cd3aa36729..e6c9ad0166 100644 --- a/csync/src/csync.c +++ b/csync/src/csync.c @@ -548,7 +548,6 @@ int csync_commit(CSYNC *ctx) { ctx->remote.read_from_db = 0; ctx->read_remote_from_db = true; ctx->db_is_empty = false; - ctx->ignore_hidden_files = true; // do NOT sync hidden files by default. /* Create new trees */ diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index c3097c96cb..6ab67cba3d 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -753,6 +753,8 @@ void Folder::startSync(const QStringList &pathList) quint64 limit = newFolderLimit.first ? newFolderLimit.second * 1000 * 1000 : -1; // convert from MB to B _engine->setNewBigFolderSizeLimit(limit); + _engine->setIgnoreHiddenFiles(_definition.ignoreHiddenFiles); + QMetaObject::invokeMethod(_engine.data(), "startSync", Qt::QueuedConnection); // disable events until syncing is done diff --git a/src/gui/folderwatcher_linux.cpp b/src/gui/folderwatcher_linux.cpp index 59e59aa475..e3c00a4af0 100644 --- a/src/gui/folderwatcher_linux.cpp +++ b/src/gui/folderwatcher_linux.cpp @@ -58,7 +58,7 @@ bool FolderWatcherPrivate::findFoldersBelow( const QDir& dir, QStringList& fullL } else { QStringList nameFilter; nameFilter << QLatin1String("*"); - QDir::Filters filter = QDir::Dirs | QDir::NoDotAndDotDot|QDir::NoSymLinks; + QDir::Filters filter = QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks | QDir::Hidden; const QStringList pathes = dir.entryList(nameFilter, filter); QStringList::const_iterator constIterator;