mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
checkPathValidityForNewFolder: Catch sync folders underneath sym links.
plus some whitespace changes.
This commit is contained in:
parent
838c072ccc
commit
c84140d293
@ -1209,15 +1209,15 @@ QString FolderMan::checkPathValidityForNewFolder(const QString& path, const QUrl
|
||||
if (!forNewDirectory && differentPathes && folderDirClean.startsWith(userDirClean)) {
|
||||
return tr("The local folder %1 already contains a folder used in a folder sync connection. "
|
||||
"Please pick another one!")
|
||||
.arg(QDir::toNativeSeparators(path));
|
||||
.arg(QDir::toNativeSeparators(path));
|
||||
}
|
||||
|
||||
QString absCleanUserFolder = QDir::cleanPath(QDir(path).canonicalPath())+'/';
|
||||
|
||||
if (differentPathes && userDirClean.startsWith( folderDirClean )) {
|
||||
if ( (forNewDirectory || differentPathes) && userDirClean.startsWith( folderDirClean )) {
|
||||
return tr("The local folder %1 is already contained in a folder used in a folder sync connection. "
|
||||
"Please pick another one!")
|
||||
.arg(QDir::toNativeSeparators(path));
|
||||
.arg(QDir::toNativeSeparators(path));
|
||||
}
|
||||
|
||||
if (differentPathes && absCleanUserFolder.startsWith( folderDirClean ) &&
|
||||
@ -1225,9 +1225,18 @@ QString FolderMan::checkPathValidityForNewFolder(const QString& path, const QUrl
|
||||
return tr("The local folder %1 is a symbolic link. "
|
||||
"The link target is already contained in a folder used in a folder sync connection. "
|
||||
"Please pick another one!")
|
||||
.arg(QDir::toNativeSeparators(path));
|
||||
.arg(QDir::toNativeSeparators(path));
|
||||
}
|
||||
|
||||
if (differentPathes && folderDirClean.startsWith(absCleanUserFolder) &&
|
||||
absCleanUserFolder != folderDirClean && !forNewDirectory ) {
|
||||
return tr("The local folder %1 contains a symbolic link. "
|
||||
"The link target contains an already synced folder "
|
||||
"Please pick another one!")
|
||||
.arg(QDir::toNativeSeparators(path));
|
||||
}
|
||||
|
||||
|
||||
if( serverUrl.isValid() && absCleanUserFolder == folderDir ) {
|
||||
QUrl folderUrl = f->accountState()->account()->url();
|
||||
QString user = f->accountState()->account()->credentials()->user();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user