mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fix LocalDirectoryUpdater to take care if is Enabled in option.
This commit is contained in:
parent
753ebdd52b
commit
c3c2671db4
@ -70,24 +70,28 @@ void LocalDirectoryUpdater::setEnabled(bool b)
|
|||||||
void LocalDirectoryUpdater::data_tick()
|
void LocalDirectoryUpdater::data_tick()
|
||||||
{
|
{
|
||||||
time_t now = time(NULL) ;
|
time_t now = time(NULL) ;
|
||||||
|
if (mIsEnabled)
|
||||||
if(now > mDelayBetweenDirectoryUpdates + mLastSweepTime)
|
|
||||||
{
|
{
|
||||||
if(sweepSharedDirectories())
|
|
||||||
{
|
if(now > mDelayBetweenDirectoryUpdates + mLastSweepTime)
|
||||||
mNeedsFullRecheck = false ;
|
{
|
||||||
mLastSweepTime = now;
|
if(sweepSharedDirectories())
|
||||||
mSharedDirectories->notifyTSChanged() ;
|
{
|
||||||
}
|
mNeedsFullRecheck = false;
|
||||||
else
|
mLastSweepTime = now ;
|
||||||
std::cerr << "(WW) sweepSharedDirectories() failed. Will do it again in a short time." << std::endl;
|
mSharedDirectories->notifyTSChanged();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
std::cerr << "(WW) sweepSharedDirectories() failed. Will do it again in a short time." << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(now > DELAY_BETWEEN_LOCAL_DIRECTORIES_TS_UPDATE + mLastTSUpdateTime)
|
||||||
|
{
|
||||||
|
mSharedDirectories->updateTimeStamps() ;
|
||||||
|
mLastTSUpdateTime = now ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(now > DELAY_BETWEEN_LOCAL_DIRECTORIES_TS_UPDATE + mLastTSUpdateTime)
|
|
||||||
{
|
|
||||||
mSharedDirectories->updateTimeStamps() ;
|
|
||||||
mLastTSUpdateTime = now ;
|
|
||||||
}
|
|
||||||
usleep(10*1000*1000);
|
usleep(10*1000*1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ int p3FileDatabase::tick()
|
|||||||
#endif
|
#endif
|
||||||
last_print_time = now ;
|
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);
|
RsServer::notify()->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user