Fixed fill of the shared files when removing a directory from share.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6999 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-01-08 16:19:56 +00:00
parent dacec52e4f
commit 8ef40bd944
2 changed files with 69 additions and 58 deletions

View File

@ -906,7 +906,6 @@ void FileIndexMonitor::updateCycle()
} }
if (cleanedCount > 0) { if (cleanedCount > 0) {
// cb->notifyListPreChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
RsServer::notify()->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0); RsServer::notify()->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
} }
} }
@ -1437,6 +1436,9 @@ bool FileIndexMonitor::inDirectoryCheck()
bool FileIndexMonitor::internal_setSharedDirectories() bool FileIndexMonitor::internal_setSharedDirectories()
{ {
int i; int i;
bool changed = false;
{
RsStackMutex stack(fiMutex) ; /* LOCKED DIRS */ RsStackMutex stack(fiMutex) ; /* LOCKED DIRS */
if (!pendingDirs) if (!pendingDirs)
@ -1503,9 +1505,18 @@ bool FileIndexMonitor::internal_setSharedDirectories()
topdirs.push_back(cit->first); topdirs.push_back(cit->first);
} }
fi.setRootDirectories(topdirs, 0); if (fi.setRootDirectories(topdirs, 0) > 0)
{
changed = true;
}
locked_saveFileIndexes(true) ; locked_saveFileIndexes(true) ;
}
if (changed)
{
RsServer::notify()->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
}
return true; return true;
} }

View File

@ -557,7 +557,7 @@ int FileIndex::setRootDirectories(const std::list<std::string> &inlist, time_t u
} }
/* remove all dirs with zero time (non recursive) */ /* remove all dirs with zero time (non recursive) */
root->removeOldEntries(utime, false); int cleanedCount = root->removeOldEntries(utime, false);
/* now flag remaining directories with correct update time */ /* now flag remaining directories with correct update time */
for(it = root->subdirs.begin(); it != root->subdirs.end(); it++) for(it = root->subdirs.begin(); it != root->subdirs.end(); it++)
@ -569,7 +569,7 @@ int FileIndex::setRootDirectories(const std::list<std::string> &inlist, time_t u
updateHashIndex() ; updateHashIndex() ;
return 1; return cleanedCount;
} }
void FileIndex::updateHashIndex() void FileIndex::updateHashIndex()