From e4568a896f31611c5d4fabaa3a151f1ed7161951 Mon Sep 17 00:00:00 2001 From: mr-alice Date: Sun, 18 Sep 2016 21:16:25 +0200 Subject: [PATCH] removed some unused code --- libretroshare/src/file_sharing/hash_cache.cc | 5 +++-- libretroshare/src/file_sharing/p3filelists.cc | 20 +++++-------------- libretroshare/src/file_sharing/p3filelists.h | 14 +++++-------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/libretroshare/src/file_sharing/hash_cache.cc b/libretroshare/src/file_sharing/hash_cache.cc index 4748e7125..becbf48f5 100644 --- a/libretroshare/src/file_sharing/hash_cache.cc +++ b/libretroshare/src/file_sharing/hash_cache.cc @@ -314,7 +314,7 @@ void HashStorage::locked_save() return ; } - std::cerr << mFiles.size() << " Entries saved." << std::endl; + std::cerr << mFiles.size() << " entries saved in hash cache." << std::endl; free(data) ; } @@ -356,9 +356,10 @@ bool HashStorage::writeHashStorageInfo(unsigned char *& data,uint32_t& total_si // now write the whole string into a single section in the file if(!FileListIO::writeField(data,total_size,offset,FILE_LIST_IO_TAG_HASH_STORAGE_ENTRY,section_data,section_offset)) return false ; - +#ifdef HASHSTORAGE_DEBUG std::cerr << "Writing hash storage section " << RsUtil::BinToHex(section_data,section_offset) << std::endl; std::cerr << "Info.filename = " << info.filename << std::endl; +#endif free(section_data) ; return true; diff --git a/libretroshare/src/file_sharing/p3filelists.cc b/libretroshare/src/file_sharing/p3filelists.cc index c67f0b322..489164c8f 100644 --- a/libretroshare/src/file_sharing/p3filelists.cc +++ b/libretroshare/src/file_sharing/p3filelists.cc @@ -773,11 +773,11 @@ int p3FileDatabase::RequestDirDetails(const RsPeerId& uid,const std::string& pat NOT_IMPLEMENTED(); return 0; } -int p3FileDatabase::RequestDirDetails(const std::string& path, DirDetails &details) const -{ - NOT_IMPLEMENTED(); - return 0; -} +//int p3FileDatabase::RequestDirDetails(const std::string& path, DirDetails &details) const +//{ +// NOT_IMPLEMENTED(); +// return 0; +//} uint32_t p3FileDatabase::getType(void *ref) const { RS_STACK_MUTEX(mFLSMtx) ; @@ -830,16 +830,6 @@ uint32_t p3FileDatabase::watchPeriod() RS_STACK_MUTEX(mFLSMtx) ; return mLocalDirWatcher->fileWatchPeriod(); } -bool p3FileDatabase::findLocalFile(const RsFileHash& hash,FileSearchFlags flags,const RsPeerId& peer_id, std::string &fullpath, uint64_t &size,FileStorageFlags& storage_flags,std::list& parent_groups) const -{ - RS_STACK_MUTEX(mFLSMtx) ; - - std::list firesults; - mLocalSharedDirs->searchHash(hash,firesults) ; - - NOT_IMPLEMENTED(); - return false; -} int p3FileDatabase::SearchKeywords(const std::list& keywords, std::list& results,FileSearchFlags flags,const RsPeerId& client_peer_id) { diff --git a/libretroshare/src/file_sharing/p3filelists.h b/libretroshare/src/file_sharing/p3filelists.h index 6b7052677..ec4e583ba 100644 --- a/libretroshare/src/file_sharing/p3filelists.h +++ b/libretroshare/src/file_sharing/p3filelists.h @@ -98,15 +98,10 @@ class p3FileDatabase: public p3Service, public p3Config, public ftSearch //, pub // virtual int tick() ; - // access to own/remote shared files - // - virtual bool findLocalFile(const RsFileHash& hash,FileSearchFlags flags,const RsPeerId& peer_id, std::string &fullpath, uint64_t &size,FileStorageFlags& storage_flags,std::list& parent_groups) const; - - virtual int SearchKeywords(const std::list& keywords, std::list& results,FileSearchFlags flags,const RsPeerId& peer_id) ; - virtual int SearchBoolExp(RsRegularExpression::Expression *exp, std::list& results,FileSearchFlags flags,const RsPeerId& peer_id) const ; - // ftSearch virtual bool search(const RsFileHash &hash, FileSearchFlags hintflags, FileInfo &info) const; + virtual int SearchKeywords(const std::list& keywords, std::list& results,FileSearchFlags flags,const RsPeerId& peer_id) ; + virtual int SearchBoolExp(RsRegularExpression::Expression *exp, std::list& results,FileSearchFlags flags,const RsPeerId& peer_id) const ; // Interface for browsing dir hierarchy // @@ -114,8 +109,6 @@ class p3FileDatabase: public p3Service, public p3Config, public ftSearch //, pub void stopThreads() ; void startThreads() ; - int RequestDirDetails(const RsPeerId& uid, const std::string& path, DirDetails &details)const; - int RequestDirDetails(const std::string& path, DirDetails &details) const ; bool findChildPointer(void *ref, int row, void *& result, FileSearchFlags flags) const; // void * here is the type expected by the abstract model index from Qt. It gets turned into a DirectoryStorage::EntryIndex internally. @@ -124,6 +117,9 @@ class p3FileDatabase: public p3Service, public p3Config, public ftSearch //, pub int RequestDirDetails(void *, DirDetails&, FileSearchFlags) const ; uint32_t getType(void *) const ; + // proxy method used by the web UI. + int RequestDirDetails(const RsPeerId& uid, const std::string& path, DirDetails &details)const; + // set/update shared directories void setSharedDirectories(const std::list& dirs);