mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-27 02:11:27 -05:00
moved file ignore test to a more appropriate place
This commit is contained in:
parent
eff5c5d6ee
commit
0ca0b72a5a
@ -199,6 +199,7 @@ void LocalDirectoryUpdater::recursUpdateSharedDir(const std::string& cumulated_p
|
||||
std::set<std::string> subdirs ;
|
||||
|
||||
for(;dirIt.isValid();dirIt.next())
|
||||
if(filterFile(dirIt.file_name()))
|
||||
{
|
||||
switch(dirIt.file_type())
|
||||
{
|
||||
@ -232,7 +233,6 @@ void LocalDirectoryUpdater::recursUpdateSharedDir(const std::string& cumulated_p
|
||||
// now go through list of subfiles and request the hash to hashcache
|
||||
|
||||
for(DirectoryStorage::FileIterator dit(mSharedDirectories,indx);dit;++dit)
|
||||
if(filterFile(dit.name()))
|
||||
{
|
||||
// ask about the hash. If not present, ask HashCache. If not present, or different, the callback will update it.
|
||||
|
||||
@ -265,12 +265,18 @@ bool LocalDirectoryUpdater::filterFile(const std::string& fname) const
|
||||
if(mIgnoreFlags & RS_FILE_SHARE_FLAGS_IGNORE_SUFFIXES)
|
||||
for(auto it(mIgnoredSuffixes.begin());it!=mIgnoredSuffixes.end();++it)
|
||||
if(fname.size() >= (*it).size() && fname.substr( fname.size() - (*it).size()) == *it)
|
||||
{
|
||||
std::cerr << "(II) ignoring file " << fname << ", because it matches suffix \"" << *it << "\"" << std::endl;
|
||||
return false ;
|
||||
}
|
||||
|
||||
if(mIgnoreFlags & RS_FILE_SHARE_FLAGS_IGNORE_PREFIXES)
|
||||
for(auto it(mIgnoredPrefixes.begin());it!=mIgnoredPrefixes.end();++it)
|
||||
if(fname.size() >= (*it).size() && fname.substr( 0,(*it).size()) == *it)
|
||||
{
|
||||
std::cerr << "(II) ignoring file " << fname << ", because it matches prefix \"" << *it << "\"" << std::endl;
|
||||
return false ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void HashStorage::data_tick()
|
||||
paused = mHashingProcessPaused ;
|
||||
}
|
||||
|
||||
if(paused)
|
||||
if(paused) // we need to wait off mutex!!
|
||||
{
|
||||
usleep(MAX_INACTIVITY_SLEEP_TIME) ;
|
||||
std::cerr << "Hashing process currently paused." << std::endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user