mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Removed the difference of the separator for Linux and Windows.
Removed extra "/" of the filename (e.g. "E://") of the hashed file when sharing a whole drive. Recompile of the gui needed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4200 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
00c1bfcf54
commit
72d9f352e3
12 changed files with 66 additions and 65 deletions
|
@ -1489,7 +1489,7 @@ bool ftController::setDownloadDirectory(std::string path)
|
|||
{
|
||||
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
|
||||
|
||||
mDownloadPath = path;
|
||||
mDownloadPath = RsDirUtil::convertPathToUnix(path);
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController::setDownloadDirectory() Okay!";
|
||||
std::cerr << std::endl;
|
||||
|
@ -1512,6 +1512,8 @@ bool ftController::setPartialsDirectory(std::string path)
|
|||
{
|
||||
RsStackMutex stack(ctrlMutex);
|
||||
|
||||
path = RsDirUtil::convertPathToUnix(path);
|
||||
|
||||
if (!path.find(mDownloadPath)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -336,7 +336,7 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
|
|||
/* ensure that it exists? */
|
||||
|
||||
SharedDirInfo info ;
|
||||
info.filename = fi->file.path;
|
||||
info.filename = RsDirUtil::convertPathToUnix(fi->file.path);
|
||||
info.virtualname = fi->file.name;
|
||||
info.shareflags = fi->flags & (RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_NETWORK_WIDE) ;
|
||||
|
||||
|
|
|
@ -593,16 +593,19 @@ bool ftServer::setSharedDirectories(std::list<SharedDirInfo> &dirs)
|
|||
|
||||
bool ftServer::addSharedDirectory(const SharedDirInfo& dir)
|
||||
{
|
||||
SharedDirInfo _dir = dir;
|
||||
_dir.filename = RsDirUtil::convertPathToUnix(_dir.filename);
|
||||
|
||||
std::list<SharedDirInfo> dirList;
|
||||
mFiMon->getSharedDirectories(dirList);
|
||||
|
||||
// check that the directory is not already in the list.
|
||||
for(std::list<SharedDirInfo>::const_iterator it(dirList.begin());it!=dirList.end();++it)
|
||||
if((*it).filename == dir.filename)
|
||||
if((*it).filename == _dir.filename)
|
||||
return false ;
|
||||
|
||||
// ok then, add the shared directory.
|
||||
dirList.push_back(dir);
|
||||
dirList.push_back(_dir);
|
||||
|
||||
mFiMon->setSharedDirectories(dirList);
|
||||
return true;
|
||||
|
@ -617,6 +620,8 @@ bool ftServer::updateShareFlags(const SharedDirInfo& info)
|
|||
|
||||
bool ftServer::removeSharedDirectory(std::string dir)
|
||||
{
|
||||
dir = RsDirUtil::convertPathToUnix(dir);
|
||||
|
||||
std::list<SharedDirInfo> dirList;
|
||||
std::list<SharedDirInfo>::iterator it;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue