From a4585d81a66fecd25824ec2484b9f17166074387 Mon Sep 17 00:00:00 2001 From: JuanJakobo Date: Fri, 12 Aug 2022 23:22:57 +0200 Subject: [PATCH] Fix issue that folder are marked as synced if locally found --- src/handler/eventHandler.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/handler/eventHandler.cpp b/src/handler/eventHandler.cpp index f737ece..ca73ce0 100644 --- a/src/handler/eventHandler.cpp +++ b/src/handler/eventHandler.cpp @@ -678,20 +678,17 @@ void EventHandler::updateItems(vector &items) { item.state = _sqllite.getState(item.path); - if (iv_access(item.localPath.c_str(), W_OK) == 0) + if (item.type == Itemtype::IFILE) { - item.state = FileState::ISYNCED; + if(iv_access(item.localPath.c_str(), W_OK) != 0) + item.state = FileState::ICLOUD; + else + item.state = FileState::ISYNCED; } else { - if(item.type == Itemtype::IFOLDER) - { + if(iv_access(item.localPath.c_str(), W_OK) != 0) iv_mkdir(item.localPath.c_str(), 0777); - } - else - { - item.state = FileState::ICLOUD; - } } if (_sqllite.getEtag(item.path).compare(item.etag) != 0)