mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 00:19:30 -05:00
Optimized parameter "hash" of method RsFiles::FileDetails from "std::string" to "const std::string&"
Removed compiler warning of FileEntry. Recompile of the GUI needed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3703 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5809e25a60
commit
ab5b2a3851
@ -80,7 +80,7 @@ class FileEntry
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileEntry()
|
FileEntry()
|
||||||
:parent(NULL), row(0) ,size(0),modtime(0),pop(0),updtime(0)
|
: size(0), modtime(0), pop(0), updtime(0), parent(NULL), row(0)
|
||||||
{ return; }
|
{ return; }
|
||||||
|
|
||||||
virtual ~FileEntry() { return; }
|
virtual ~FileEntry() { return; }
|
||||||
|
@ -190,11 +190,12 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t f
|
|||||||
|
|
||||||
lockData();
|
lockData();
|
||||||
|
|
||||||
if(ref != NULL && !FileIndex::isValid(ref))
|
// checked by FileIndex::extractData
|
||||||
{
|
// if(ref != NULL && !FileIndex::isValid(ref))
|
||||||
unlockData() ;
|
// {
|
||||||
return false ;
|
// unlockData() ;
|
||||||
}
|
// return false ;
|
||||||
|
// }
|
||||||
|
|
||||||
/* so cast *ref to a DirEntry */
|
/* so cast *ref to a DirEntry */
|
||||||
/* root case */
|
/* root case */
|
||||||
|
@ -1544,7 +1544,7 @@ std::string ftController::getPartialsDirectory()
|
|||||||
return mPartialsPath;
|
return mPartialsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ftController::FileDetails(std::string hash, FileInfo &info)
|
bool ftController::FileDetails(const std::string &hash, FileInfo &info)
|
||||||
{
|
{
|
||||||
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
|
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu
|
|||||||
bool setPartialsDirectory(std::string path);
|
bool setPartialsDirectory(std::string path);
|
||||||
std::string getDownloadDirectory();
|
std::string getDownloadDirectory();
|
||||||
std::string getPartialsDirectory();
|
std::string getPartialsDirectory();
|
||||||
bool FileDetails(std::string hash, FileInfo &info);
|
bool FileDetails(const std::string &hash, FileInfo &info);
|
||||||
|
|
||||||
bool moveFile(const std::string& source,const std::string& dest) ;
|
bool moveFile(const std::string& source,const std::string& dest) ;
|
||||||
bool copyFile(const std::string& source,const std::string& dest) ;
|
bool copyFile(const std::string& source,const std::string& dest) ;
|
||||||
|
@ -121,7 +121,7 @@ bool ftDataMultiplex::FileDownloads(std::list<std::string> &hashs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ftDataMultiplex::FileDetails(std::string hash, uint32_t hintsflag, FileInfo &info)
|
bool ftDataMultiplex::FileDetails(const std::string &hash, uint32_t hintsflag, FileInfo &info)
|
||||||
{
|
{
|
||||||
#ifdef MPLEX_DEBUG
|
#ifdef MPLEX_DEBUG
|
||||||
std::cerr << "ftDataMultiplex::FileDetails(";
|
std::cerr << "ftDataMultiplex::FileDetails(";
|
||||||
|
@ -94,7 +94,7 @@ class ftDataMultiplex: public ftDataRecv, public RsQueueThread
|
|||||||
/* get Details of File Transfers */
|
/* get Details of File Transfers */
|
||||||
bool FileUploads(std::list<std::string> &hashs);
|
bool FileUploads(std::list<std::string> &hashs);
|
||||||
bool FileDownloads(std::list<std::string> &hashs);
|
bool FileDownloads(std::list<std::string> &hashs);
|
||||||
bool FileDetails(std::string hash, uint32_t hintsflag, FileInfo &info);
|
bool FileDetails(const std::string &hash, uint32_t hintsflag, FileInfo &info);
|
||||||
|
|
||||||
void deleteUnusedServers() ;
|
void deleteUnusedServers() ;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ ftFiStore::ftFiStore(CacheStrapper *cs, CacheTransfer *cft, NotifyBase *cb_in,p3
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ftFiStore::search(std::string hash, uint32_t hintflags, FileInfo &info) const
|
bool ftFiStore::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||||
{
|
{
|
||||||
/* could use hintflags to specify which bits of fileinfo to use additionally.
|
/* could use hintflags to specify which bits of fileinfo to use additionally.
|
||||||
eg. hintflags & FT_SEARCH_PEER_ID, then only return matching peers + hash.
|
eg. hintflags & FT_SEARCH_PEER_ID, then only return matching peers + hash.
|
||||||
@ -125,7 +125,7 @@ ftFiMonitor::ftFiMonitor(CacheStrapper *cs,NotifyBase *cb_in, std::string cached
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ftFiMonitor::search(std::string hash, uint32_t hintflags, FileInfo &info) const
|
bool ftFiMonitor::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||||
{
|
{
|
||||||
uint64_t fsize;
|
uint64_t fsize;
|
||||||
std::string path;
|
std::string path;
|
||||||
@ -271,7 +271,7 @@ ftCacheStrapper::ftCacheStrapper(p3ConnectMgr *cm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* overloaded search function */
|
/* overloaded search function */
|
||||||
bool ftCacheStrapper::search(std::string hash, uint32_t hintflags, FileInfo &info) const
|
bool ftCacheStrapper::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||||
{
|
{
|
||||||
#ifdef DB_DEBUG
|
#ifdef DB_DEBUG
|
||||||
std::cerr << "ftCacheStrapper::search(" << hash << "," << hintflags;
|
std::cerr << "ftCacheStrapper::search(" << hash << "," << hintflags;
|
||||||
|
@ -51,7 +51,7 @@ class ftFiStore: public FileIndexStore, public ftSearch
|
|||||||
RsPeerId ownid, std::string cachedir);
|
RsPeerId ownid, std::string cachedir);
|
||||||
|
|
||||||
/* overloaded search function */
|
/* overloaded search function */
|
||||||
virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const;
|
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ftFiMonitor: public FileIndexMonitor, public ftSearch, public p3Config
|
class ftFiMonitor: public FileIndexMonitor, public ftSearch, public p3Config
|
||||||
@ -60,7 +60,7 @@ class ftFiMonitor: public FileIndexMonitor, public ftSearch, public p3Config
|
|||||||
ftFiMonitor(CacheStrapper *cs,NotifyBase *cb_in, std::string cachedir, std::string pid);
|
ftFiMonitor(CacheStrapper *cs,NotifyBase *cb_in, std::string cachedir, std::string pid);
|
||||||
|
|
||||||
/* overloaded search function */
|
/* overloaded search function */
|
||||||
virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const;
|
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||||
|
|
||||||
/* overloaded set dirs enables config indication */
|
/* overloaded set dirs enables config indication */
|
||||||
virtual void setSharedDirectories(const std::list<SharedDirInfo>& dirList);
|
virtual void setSharedDirectories(const std::list<SharedDirInfo>& dirList);
|
||||||
@ -84,7 +84,7 @@ class ftCacheStrapper: public CacheStrapper, public ftSearch
|
|||||||
ftCacheStrapper(p3ConnectMgr *cm);
|
ftCacheStrapper(p3ConnectMgr *cm);
|
||||||
|
|
||||||
/* overloaded search function */
|
/* overloaded search function */
|
||||||
virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const;
|
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ bool ftExtraList::hashExtraFileDone(std::string path, FileInfo &info)
|
|||||||
* Search Function - used by File Transfer
|
* Search Function - used by File Transfer
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
bool ftExtraList::search(std::string hash, uint32_t hintflags, FileInfo &info) const
|
bool ftExtraList::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef DEBUG_ELIST
|
#ifdef DEBUG_ELIST
|
||||||
|
@ -138,7 +138,7 @@ bool hashExtraFileDone(std::string path, FileInfo &info);
|
|||||||
* implementation of ftSearch.
|
* implementation of ftSearch.
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const;
|
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* Thread Main Loop
|
* Thread Main Loop
|
||||||
|
@ -75,7 +75,7 @@ bool ftFileSearch::addSearchMode(ftSearch *search, uint32_t hintflags)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ftFileSearch::search(std::string hash, uint32_t hintflags, FileInfo &info) const
|
bool ftFileSearch::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||||
{
|
{
|
||||||
uint32_t hints, i;
|
uint32_t hints, i;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class ftFileSearch: public ftSearch
|
|||||||
ftFileSearch();
|
ftFileSearch();
|
||||||
|
|
||||||
bool addSearchMode(ftSearch *search, uint32_t hintflags);
|
bool addSearchMode(ftSearch *search, uint32_t hintflags);
|
||||||
virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const;
|
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class ftSearch
|
|||||||
|
|
||||||
ftSearch() { return; }
|
ftSearch() { return; }
|
||||||
virtual ~ftSearch() { return; }
|
virtual ~ftSearch() { return; }
|
||||||
virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const = 0;
|
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ bool ftServer::FileUploads(std::list<std::string> &hashs)
|
|||||||
return mFtDataplex->FileUploads(hashs);
|
return mFtDataplex->FileUploads(hashs);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ftServer::FileDetails(std::string hash, uint32_t hintflags, FileInfo &info)
|
bool ftServer::FileDetails(const std::string &hash, uint32_t hintflags, FileInfo &info)
|
||||||
{
|
{
|
||||||
if (hintflags & RS_FILE_HINTS_DOWNLOAD)
|
if (hintflags & RS_FILE_HINTS_DOWNLOAD)
|
||||||
if(mFtController->FileDetails(hash, info))
|
if(mFtController->FileDetails(hash, info))
|
||||||
|
@ -148,7 +148,7 @@ virtual bool clearDownload(const std::string hash);
|
|||||||
***/
|
***/
|
||||||
virtual bool FileDownloads(std::list<std::string> &hashs);
|
virtual bool FileDownloads(std::list<std::string> &hashs);
|
||||||
virtual bool FileUploads(std::list<std::string> &hashs);
|
virtual bool FileUploads(std::list<std::string> &hashs);
|
||||||
virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info);
|
virtual bool FileDetails(const std::string &hash, uint32_t hintflags, FileInfo &info);
|
||||||
virtual bool FileDownloadChunksDetails(const std::string& hash,FileChunksInfo& info) ;
|
virtual bool FileDownloadChunksDetails(const std::string& hash,FileChunksInfo& info) ;
|
||||||
virtual bool FileUploadChunksDetails(const std::string& hash,const std::string& peer_id,CompressedChunkMap& map) ;
|
virtual bool FileUploadChunksDetails(const std::string& hash,const std::string& peer_id,CompressedChunkMap& map) ;
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ class RsFiles
|
|||||||
***/
|
***/
|
||||||
virtual bool FileDownloads(std::list<std::string> &hashs) = 0;
|
virtual bool FileDownloads(std::list<std::string> &hashs) = 0;
|
||||||
virtual bool FileUploads(std::list<std::string> &hashs) = 0;
|
virtual bool FileUploads(std::list<std::string> &hashs) = 0;
|
||||||
virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info) = 0;
|
virtual bool FileDetails(const std::string &hash, uint32_t hintflags, FileInfo &info) = 0;
|
||||||
|
|
||||||
/// Gives chunk details about the downloaded file with given hash.
|
/// Gives chunk details about the downloaded file with given hash.
|
||||||
virtual bool FileDownloadChunksDetails(const std::string& hash,FileChunksInfo& info) = 0 ;
|
virtual bool FileDownloadChunksDetails(const std::string& hash,FileChunksInfo& info) = 0 ;
|
||||||
|
Loading…
Reference in New Issue
Block a user