Add and remove watches for folders independent from sync dir.

Before it was just in case of download.
This commit is contained in:
Klaas Freitag 2014-01-23 13:18:58 +01:00
Родитель e9e132c06c
Коммит 5841cf4020
1 изменённых файлов: 10 добавлений и 12 удалений

Просмотреть файл

@ -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: