mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
Added Check for the existance of each Cache File before that are passed on the loader.
This should once and for-all remove the copy file warnings - I hope ;) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4343 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4e56166e3f
commit
66b9f42835
@ -918,24 +918,48 @@ bool CacheStrapper::loadList(std::list<RsItem *>& load)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cd.pid == ownId)
|
/* check that the file exists first.... */
|
||||||
{
|
std::string filename = cd.path;
|
||||||
/* load local */
|
filename += "/";
|
||||||
(it2 -> second).source -> loadLocalCache(cd);
|
filename += cd.name;
|
||||||
#ifdef CS_DEBUG
|
#ifdef CS_DEBUG
|
||||||
std::cerr << "CacheStrapper::loadList() loaded Local";
|
std::cerr << "CacheStrapper::loadList() Checking File: " << filename;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool fileExists = RsDirUtil::checkFile(filename);
|
||||||
|
if (fileExists)
|
||||||
|
{
|
||||||
|
#ifdef CS_DEBUG
|
||||||
|
std::cerr << "CacheStrapper::loadList() Exists ... continuing";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
if (cd.pid == ownId)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* load local */
|
||||||
|
(it2 -> second).source -> loadLocalCache(cd);
|
||||||
|
#ifdef CS_DEBUG
|
||||||
|
std::cerr << "CacheStrapper::loadList() loaded Local";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* load remote */
|
||||||
|
(it2 -> second).store -> loadCache(cd);
|
||||||
|
#ifdef CS_DEBUG
|
||||||
|
std::cerr << "CacheStrapper::loadList() loaded Remote";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* load remote */
|
std::cerr << "CacheStrapper::loadList() Doesn't Exist dropping: " << filename;
|
||||||
(it2 -> second).store -> loadCache(cd);
|
|
||||||
#ifdef CS_DEBUG
|
|
||||||
std::cerr << "CacheStrapper::loadList() loaded Remote";
|
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
|
Loading…
Reference in New Issue
Block a user