mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 10:35:22 -04:00
Fix Partial Dir Check
Add WrongValue StyleSheet property, when bad directory selected. Update QLineEdit with current setting so it's possible to see if something is modified. No need to restart.
This commit is contained in:
parent
57cff61873
commit
f12cd5774d
9 changed files with 120 additions and 58 deletions
|
@ -1472,24 +1472,24 @@ bool ftController::setPartialsDirectory(std::string path)
|
|||
|
||||
/* check it is not a subdir of download / shared directories (BAD) - TODO */
|
||||
{
|
||||
RsStackMutex stack(ctrlMutex);
|
||||
RsStackMutex stack(ctrlMutex);
|
||||
|
||||
path = RsDirUtil::convertPathToUnix(path);
|
||||
path = RsDirUtil::convertPathToUnix(path);
|
||||
|
||||
if (path.find(mDownloadPath) == std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
if (path.find(mDownloadPath) != std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rsFiles) {
|
||||
std::list<SharedDirInfo>::iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
for (it = dirs.begin(); it != dirs.end(); ++it) {
|
||||
if (path.find((*it).filename) == std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rsFiles) {
|
||||
std::list<SharedDirInfo>::iterator it;
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
for (it = dirs.begin(); it != dirs.end(); ++it) {
|
||||
if (path.find((*it).filename) != std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check if it exists */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue