Skip to content

Commit

Permalink
Fix issue that folder are marked as synced if locally found
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanJakobo committed Aug 12, 2022
1 parent 34e7664 commit a4585d8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/handler/eventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,20 +678,17 @@ void EventHandler::updateItems(vector<WebDAVItem> &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)
Expand Down

0 comments on commit a4585d8

Please sign in to comment.