]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
* fix for issue no. 1351
authorAdrian Brzezinski <adrian.brzezinski@eo.pl>
Thu, 17 Oct 2019 12:45:38 +0000 (14:45 +0200)
committerAdrian Brzezinski <adrian.brzezinski@eo.pl>
Fri, 18 Oct 2019 06:16:59 +0000 (08:16 +0200)
Signed-off-by: Adrian Brzezinski <adrian.brzezinski@eo.pl>
src/gui/folder.cpp

index c8d0e645ba297ea34c88c474a5e246dee68b0452..c6d78b4bbccdb9d8c8e2824871d5bb5b510df4e9 100644 (file)
@@ -902,13 +902,19 @@ void Folder::slotItemCompleted(const SyncFileItemPtr &item)
     }
 
     // add new directories or remove gone away dirs to the watcher
-    if (item->isDirectory() && item->_instruction == CSYNC_INSTRUCTION_NEW) {
-        if (_folderWatcher)
-            _folderWatcher->addPath(path() + item->_file);
-    }
-    if (item->isDirectory() && item->_instruction == CSYNC_INSTRUCTION_REMOVE) {
-        if (_folderWatcher)
-            _folderWatcher->removePath(path() + item->_file);
+    if (_folderWatcher && item->isDirectory()) {
+       switch (item->_instruction) {
+           case CSYNC_INSTRUCTION_NEW:
+                _folderWatcher->addPath(path() + item->_file);
+           break;
+           case CSYNC_INSTRUCTION_REMOVE:
+                _folderWatcher->removePath(path() + item->_file);
+           break;
+           case CSYNC_INSTRUCTION_RENAME:
+                _folderWatcher->removePath(path() + item->_file);
+                _folderWatcher->addPath(path() + item->destination());
+           break;
+       }
     }
 
     // Success and failure of sync items adjust what the next sync is