Merge pull request #700 from PhenomRetroShare/Fix_LocalDirectoryUpdaterTakeCareIfEnabled

Fix LocalDirectoryUpdater to take care if is Enabled in option.
This commit is contained in:
csoler 2017-02-26 17:54:51 +01:00 committed by GitHub
commit 7028bb5844
2 changed files with 20 additions and 16 deletions

View file

@ -70,6 +70,8 @@ void LocalDirectoryUpdater::setEnabled(bool b)
void LocalDirectoryUpdater::data_tick()
{
time_t now = time(NULL) ;
if (mIsEnabled)
{
if(now > mDelayBetweenDirectoryUpdates + mLastSweepTime)
{
@ -88,6 +90,8 @@ void LocalDirectoryUpdater::data_tick()
mSharedDirectories->updateTimeStamps() ;
mLastTSUpdateTime = now ;
}
}
usleep(10*1000*1000);
}

View file

@ -179,7 +179,7 @@ int p3FileDatabase::tick()
#endif
last_print_time = now ;
//#warning this should be removed, but it's necessary atm for updating the GUI
#warning mr-alice 2016-08-19: This should be removed, but it's necessary atm for updating the GUI
RsServer::notify()->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
}