From 5841cf40204c2f4cb55d1afffb5ca1450bc67c77 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 23 Jan 2014 13:18:58 +0100 Subject: [PATCH] Add and remove watches for folders independent from sync dir. Before it was just in case of download. --- src/mirall/folder.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp index d06c1a453..02d154109 100644 --- a/src/mirall/folder.cpp +++ b/src/mirall/folder.cpp @@ -315,29 +315,27 @@ void Folder::bubbleUpSyncResult() logger->postOptionalGuiLog(tr("File %1").arg(item._file), item._errorString); } else { + // add new directories or remove gone away dirs to the watcher + if (item._type == SyncFileItem::Directory && + item._instruction == CSYNC_INSTRUCTION_NEW ) { + FolderMan::instance()->addMonitorPath( alias(), path()+item._file ); + } + if (item._type == SyncFileItem::Directory && + item._instruction == CSYNC_INSTRUCTION_REMOVE ) { + FolderMan::instance()->removeMonitorPath( alias(), path()+item._file ); + } + if (item._dir == SyncFileItem::Down) { switch (item._instruction) { case CSYNC_INSTRUCTION_NEW: newItems++; if (firstItemNew.isEmpty()) firstItemNew = item; - - if (item._type == SyncFileItem::Directory) { - FolderMan::instance()->addMonitorPath( alias(), path()+item._file ); - // _watcher->addPath(path() + item._file); - } - break; case CSYNC_INSTRUCTION_REMOVE: removedItems++; if (firstItemDeleted.isEmpty()) firstItemDeleted = item; - - if (item._type == SyncFileItem::Directory) { - // _watcher->removePath(path() + item._file); - FolderMan::instance()->removeMonitorPath( alias(), path()+item._file ); - } - break; case CSYNC_INSTRUCTION_CONFLICT: case CSYNC_INSTRUCTION_SYNC: