mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 19:12:28 -04:00
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:
parent
4779d83ab7
commit
af4dd635e3
11 changed files with 68 additions and 143 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue