mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 08:43:08 -07:00
Method to update the watch path parameters.
This commit is contained in:
parent
990e33a4b1
commit
429a1ba78a
2 changed files with 17 additions and 0 deletions
|
@ -230,6 +230,22 @@ ScanFoldersModel::PathStatus ScanFoldersModel::addPath(const QString &watchPath,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
ScanFoldersModel::PathStatus ScanFoldersModel::updatePath(const QString &watchPath, const PathType& downloadType, const QString &downloadPath)
|
||||
{
|
||||
QDir watchDir(watchPath);
|
||||
const QString &canonicalWatchPath = watchDir.canonicalPath();
|
||||
int row = findPathData(canonicalWatchPath);
|
||||
if (row == -1) return DoesNotExist;
|
||||
|
||||
QDir downloadDir(downloadPath);
|
||||
const QString &canonicalDownloadPath = downloadDir.canonicalPath();
|
||||
|
||||
m_pathList.at(row)->downloadType = downloadType;
|
||||
m_pathList.at(row)->downloadPath = Utils::Fs::toNativePath(canonicalDownloadPath);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
void ScanFoldersModel::addToFSWatcher(const QStringList &watchPaths)
|
||||
{
|
||||
if (!m_fsWatcher)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue