Skip to content

Commit

Permalink
Display the local folder path when warning that folder is already bei…
Browse files Browse the repository at this point in the history
…ng synced.

Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Jan 27, 2025
1 parent 15ae4ea commit 9c02bf3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/gui/folderwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,19 +499,20 @@ bool FolderWizardRemotePath::isComplete() const
continue;
}

const auto currentDir = folder->remotePathTrailingSlash();
if (QDir::cleanPath(targetPath) == QDir::cleanPath(currentDir)) {
showWarn(tr("Please choose a different location. %1 is already being used as a sync folder.").arg(Utility::escape(currentDir)));
const auto remoteDir = folder->remotePathTrailingSlash();
const auto localDir = folder->cleanPath();
if (QDir::cleanPath(targetPath) == QDir::cleanPath(remoteDir)) {
showWarn(tr("Please choose a different location. %1 is already being synced to %2.").arg(Utility::escape(remoteDir), Utility::escape(localDir)));
break;
}

if (targetPath.startsWith(currentDir)) {
showWarn(tr("Please choose a different location. %1 is already being synced in %2.").arg(Utility::escape(targetPath), Utility::escape(currentDir)));
if (targetPath.startsWith(remoteDir)) {
showWarn(tr("Please choose a different location. %1 is already being synced to %2.").arg(Utility::escape(targetPath), Utility::escape(localDir)));
break;
}

if (currentDir.startsWith(targetPath)) {
showWarn(tr("Please choose a different location. %1 is already being synced in %2.").arg(Utility::escape(currentDir), Utility::escape(targetPath)));
if (remoteDir.startsWith(targetPath)) {
showWarn(tr("Please choose a different location. %1 is already being synced to %2.").arg(Utility::escape(remoteDir), Utility::escape(localDir)));
break;
}
}
Expand Down

0 comments on commit 9c02bf3

Please sign in to comment.