mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -05:00
Merge pull request #1250 from PhenomRetroShare/Fix_CppCheckerWarningInFtController
Fix CppCheck in ftcontroller.cc
This commit is contained in:
commit
c20436e215
@ -88,16 +88,13 @@ ftFileControl::ftFileControl()
|
||||
return;
|
||||
}
|
||||
|
||||
ftFileControl::ftFileControl(std::string fname,
|
||||
std::string tmppath, std::string dest,
|
||||
uint64_t size, const RsFileHash &hash, TransferRequestFlags flags,
|
||||
ftFileCreator *fc, ftTransferModule *tm)
|
||||
:mName(fname), mCurrentPath(tmppath), mDestination(dest),
|
||||
mTransfer(tm), mCreator(fc), mState(DOWNLOADING), mHash(hash),
|
||||
mSize(size), mFlags(flags), mCreateTime(0), mQueuePriority(0), mQueuePosition(0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ftFileControl::ftFileControl(const std::string& fname, const std::string& tmppath, const std::string& dest
|
||||
, uint64_t size, const RsFileHash &hash, TransferRequestFlags flags
|
||||
, ftFileCreator *fc, ftTransferModule *tm)
|
||||
: mName(fname), mCurrentPath(tmppath), mDestination(dest)
|
||||
, mTransfer(tm), mCreator(fc), mState(DOWNLOADING), mHash(hash)
|
||||
, mSize(size), mFlags(flags), mCreateTime(0), mQueuePriority(0), mQueuePosition(0)
|
||||
{}
|
||||
|
||||
ftController::ftController(ftDataMultiplex *dm, p3ServiceControl *sc, uint32_t ftServiceId)
|
||||
: p3Config(),
|
||||
@ -1479,7 +1476,7 @@ bool ftController::setPartialsDirectory(std::string path)
|
||||
|
||||
path = RsDirUtil::convertPathToUnix(path);
|
||||
|
||||
if (!path.find(mDownloadPath)) {
|
||||
if (path.find(mDownloadPath) == std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1488,7 +1485,7 @@ bool ftController::setPartialsDirectory(std::string path)
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
for (it = dirs.begin(); it != dirs.end(); ++it) {
|
||||
if (!path.find((*it).filename)) {
|
||||
if (path.find((*it).filename) == std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -73,9 +73,9 @@ class ftFileControl
|
||||
};
|
||||
|
||||
ftFileControl();
|
||||
ftFileControl(std::string fname, std::string tmppath, std::string dest,
|
||||
uint64_t size, const RsFileHash& hash, TransferRequestFlags flags,
|
||||
ftFileCreator *fc, ftTransferModule *tm);
|
||||
ftFileControl( const std::string& fname, const std::string& tmppath, const std::string& dest
|
||||
, uint64_t size, const RsFileHash& hash, TransferRequestFlags flags
|
||||
, ftFileCreator *fc, ftTransferModule *tm);
|
||||
|
||||
std::string mName;
|
||||
std::string mCurrentPath; /* current full path (including name) */
|
||||
|
Loading…
Reference in New Issue
Block a user