mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-27 10:21:40 -05:00
bug fixing when storing incoming and partials directory
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1296 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
211acc6adf
commit
9b7d486d6c
@ -974,6 +974,7 @@ bool ftController::setDownloadDirectory(std::string path)
|
||||
std::cerr << "ftController::setDownloadDirectory() Okay!";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
IndicateConfigChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -988,6 +989,24 @@ bool ftController::setPartialsDirectory(std::string path)
|
||||
{
|
||||
|
||||
/* check it is not a subdir of download / shared directories (BAD) - TODO */
|
||||
{
|
||||
RsStackMutex stack(ctrlMutex);
|
||||
|
||||
if (!path.find(mDownloadPath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rsFiles) {
|
||||
std::list<std::string>::iterator it;
|
||||
std::list<std::string> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
for (it = dirs.begin(); it != dirs.end(); it++) {
|
||||
if (!path.find(*it)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check if it exists */
|
||||
|
||||
@ -1005,6 +1024,7 @@ bool ftController::setPartialsDirectory(std::string path)
|
||||
(it->second).mCreator->changePartialDirectory(mPartialPath);
|
||||
}
|
||||
#endif
|
||||
IndicateConfigChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1437,7 +1457,7 @@ bool ftController::loadConfigMap(std::map<std::string, std::string> &configMap)
|
||||
|
||||
if (configMap.end() != (mit = configMap.find(partial_dir_ss)))
|
||||
{
|
||||
//setPartialsDirectory(mit->second);
|
||||
setPartialsDirectory(mit->second);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -43,7 +43,7 @@ DirectoriesDialog::DirectoriesDialog(QWidget *parent)
|
||||
ui.addButton->setToolTip(tr("Add a Share Directory"));
|
||||
ui.removeButton->setToolTip(tr("Remove Shared Directory"));
|
||||
ui.incomingButton->setToolTip(tr("Browse"));
|
||||
ui.partialButton->setToolTip(tr("Erowse"));
|
||||
ui.partialButton->setToolTip(tr("Browse"));
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user