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:
Phenom 2018-05-12 14:31:17 +02:00
parent 57cff61873
commit f12cd5774d
9 changed files with 120 additions and 58 deletions

View file

@ -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 */