Fix #24 Enhance tests if file is still aviable
parent
251fe28688
commit
5959f2e7a0
|
@ -137,6 +137,14 @@ std::vector<WebDAVItem> SqliteConnector::getItemsChildren(const string &parentPa
|
||||||
temp.type = static_cast<Itemtype>(sqlite3_column_int(stmt,7));
|
temp.type = static_cast<Itemtype>(sqlite3_column_int(stmt,7));
|
||||||
temp.state = static_cast<FileState>(sqlite3_column_int(stmt,8));
|
temp.state = static_cast<FileState>(sqlite3_column_int(stmt,8));
|
||||||
|
|
||||||
|
if(iv_access(temp.localPath.c_str(), W_OK) != 0)
|
||||||
|
{
|
||||||
|
if(temp.type == Itemtype::IFILE)
|
||||||
|
temp.state = FileState::ICLOUD;
|
||||||
|
else
|
||||||
|
iv_mkdir(temp.localPath.c_str(), 0777);
|
||||||
|
}
|
||||||
|
|
||||||
items.push_back(temp);
|
items.push_back(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -554,9 +554,14 @@ void EventHandler::updateItems(vector<WebDAVItem> &items)
|
||||||
{
|
{
|
||||||
item.state = _sqllite.getState(item.path);
|
item.state = _sqllite.getState(item.path);
|
||||||
|
|
||||||
//TODO integrate for files
|
if(iv_access(item.localPath.c_str(), W_OK) != 0)
|
||||||
//if (iv_access(temp.localPath.c_str(), W_OK) != 0)
|
{
|
||||||
//temp.state = FileState::ICLOUD;
|
if(item.type == Itemtype::IFILE)
|
||||||
|
item.state = FileState::ICLOUD;
|
||||||
|
else
|
||||||
|
iv_mkdir(item.localPath.c_str(), 0777);
|
||||||
|
}
|
||||||
|
|
||||||
if(_sqllite.getEtag(item.path).compare(item.etag) != 0)
|
if(_sqllite.getEtag(item.path).compare(item.etag) != 0)
|
||||||
{
|
{
|
||||||
if( item.state == FileState::ISYNCED)
|
if( item.state == FileState::ISYNCED)
|
||||||
|
|
Loading…
Reference in New Issue