Removed member ftController::mShareDownloadDir and calculate the value from the shared directories.

Combined the two methods for share and unshare of the download dir.
Added share incoming directory to the QuickStartWizard.
Recompile of the GUI needed.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4089 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-03-08 20:05:36 +00:00
parent 4779d83ab7
commit af4dd635e3
11 changed files with 68 additions and 143 deletions

View file

@ -665,27 +665,33 @@ void ftServer::clearHashCache()
mFiMon->clearHashCache() ;
}
void ftServer::setShareDownloadDirectory(bool value)
{
mFtController->setShareDownloadDirectory(value);
}
bool ftServer::getShareDownloadDirectory()
{
return mFtController->getShareDownloadDirectory();
std::list<SharedDirInfo> dirList;
mFiMon->getSharedDirectories(dirList);
std::string dir = mFtController->getDownloadDirectory();
// check if the download directory is in the list.
for (std::list<SharedDirInfo>::const_iterator it(dirList.begin()); it != dirList.end(); ++it)
if ((*it).filename == dir)
return true;
return false;
}
bool ftServer::shareDownloadDirectory()
bool ftServer::shareDownloadDirectory(bool share)
{
SharedDirInfo inf ;
inf.filename = mFtController->getDownloadDirectory();
inf.shareflags = RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_BROWSABLE ;
if (share) {
/* Share */
SharedDirInfo inf ;
inf.filename = mFtController->getDownloadDirectory();
inf.shareflags = RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_BROWSABLE ;
return addSharedDirectory(inf);
}
return addSharedDirectory(inf);
}
bool ftServer::unshareDownloadDirectory()
{
/* Unshare */
std::string dir = mFtController->getDownloadDirectory();
return removeSharedDirectory(dir);
}