added load/save of own file hierarchy

This commit is contained in:
csoler 2016-11-17 19:03:53 +01:00
parent ff4e6f3b2c
commit 36755c4092
4 changed files with 55 additions and 48 deletions

View file

@ -66,7 +66,7 @@ p3FileDatabase::p3FileDatabase(p3ServiceControl *mpeers)
mRemoteDirectories.clear() ; // we should load them!
mOwnId = mpeers->getOwnId() ;
mLocalSharedDirs = new LocalDirectoryStorage("local_file_store.bin",mOwnId);
mLocalSharedDirs = new LocalDirectoryStorage(mFileSharingDir + "/" + LOCAL_SHARED_DIRS_FILE_NAME,mOwnId);
mHashCache = new HashStorage(mFileSharingDir + "/" + HASH_CACHE_FILE_NAME) ;
mLocalDirWatcher = new LocalDirectoryUpdater(mHashCache,mLocalSharedDirs) ;
@ -219,6 +219,7 @@ int p3FileDatabase::tick()
}
mLastRemoteDirSweepTS = now;
mLocalSharedDirs->checkSave() ;
// This is a hack to make loaded directories show up in the GUI, because the GUI generally isn't ready at the time they are actually loaded up,
// so the first notify is ignored, and no other notify will happen next.