mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Method to update the watch path parameters.
This commit is contained in:
parent
990e33a4b1
commit
429a1ba78a
@ -230,6 +230,22 @@ ScanFoldersModel::PathStatus ScanFoldersModel::addPath(const QString &watchPath,
|
|||||||
return Ok;
|
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)
|
void ScanFoldersModel::addToFSWatcher(const QStringList &watchPaths)
|
||||||
{
|
{
|
||||||
if (!m_fsWatcher)
|
if (!m_fsWatcher)
|
||||||
|
@ -82,6 +82,7 @@ public:
|
|||||||
// TODO: removePaths(); singular version becomes private helper functions;
|
// TODO: removePaths(); singular version becomes private helper functions;
|
||||||
// also: remove functions should take modelindexes
|
// also: remove functions should take modelindexes
|
||||||
PathStatus addPath(const QString &watchPath, const PathType& downloadType, const QString &downloadPath, bool addToFSWatcher = true);
|
PathStatus addPath(const QString &watchPath, const PathType& downloadType, const QString &downloadPath, bool addToFSWatcher = true);
|
||||||
|
PathStatus updatePath(const QString &watchPath, const PathType& downloadType, const QString &downloadPath);
|
||||||
// PRECONDITION: The paths must have been added with addPath() first.
|
// PRECONDITION: The paths must have been added with addPath() first.
|
||||||
void addToFSWatcher(const QStringList &watchPaths);
|
void addToFSWatcher(const QStringList &watchPaths);
|
||||||
void removePath(int row);
|
void removePath(int row);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user