Properly create "clean path" for watched folder

This commit is contained in:
Vladimir Golovnev (glassez)
2021-07-08 12:22:14 +03:00
committed by Vladimir Golovnev
parent ede42910da
commit 3ac8c97e6f
2 changed files with 9 additions and 12 deletions

View File

@@ -267,11 +267,10 @@ QString TorrentFilesWatcher::makeCleanPath(const QString &path)
if (path.isEmpty())
throw InvalidArgument(tr("Watched folder path cannot be empty."));
const QDir dir {path};
if (dir.isRelative())
if (QDir::isRelativePath(path))
throw InvalidArgument(tr("Watched folder path cannot be relative."));
return dir.canonicalPath();
return QDir::cleanPath(path);
}
void TorrentFilesWatcher::load()