Fix issue that folder are marked as synced if locally found

master 0.99
JuanJakobo 2022-08-12 23:22:57 +02:00
parent 34e766498f
commit a4585d81a6
1 changed files with 6 additions and 9 deletions

View File

@ -678,21 +678,18 @@ void EventHandler::updateItems(vector<WebDAVItem> &items)
{ {
item.state = _sqllite.getState(item.path); item.state = _sqllite.getState(item.path);
if (iv_access(item.localPath.c_str(), W_OK) == 0) if (item.type == Itemtype::IFILE)
{ {
if(iv_access(item.localPath.c_str(), W_OK) != 0)
item.state = FileState::ICLOUD;
else
item.state = FileState::ISYNCED; item.state = FileState::ISYNCED;
} }
else else
{ {
if(item.type == Itemtype::IFOLDER) if(iv_access(item.localPath.c_str(), W_OK) != 0)
{
iv_mkdir(item.localPath.c_str(), 0777); iv_mkdir(item.localPath.c_str(), 0777);
} }
else
{
item.state = FileState::ICLOUD;
}
}
if (_sqllite.getEtag(item.path).compare(item.etag) != 0) if (_sqllite.getEtag(item.path).compare(item.etag) != 0)
item.state = (item.state == FileState::ISYNCED) ? FileState::IOUTSYNCED : FileState::ICLOUD; item.state = (item.state == FileState::ISYNCED) ? FileState::IOUTSYNCED : FileState::ICLOUD;