mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 21:28:07 -06:00
Remove watch folders permanently only if the user accepts the Preferences dialog.
This commit is contained in:
@@ -268,24 +268,31 @@ void ScanFoldersModel::addToFSWatcher(const QStringList &watchPaths)
|
||||
}
|
||||
}
|
||||
|
||||
void ScanFoldersModel::removePath(int row)
|
||||
void ScanFoldersModel::removePath(int row, bool removeFromFSWatcher)
|
||||
{
|
||||
Q_ASSERT((row >= 0) && (row < rowCount()));
|
||||
beginRemoveRows(QModelIndex(), row, row);
|
||||
m_fsWatcher->removePath(m_pathList.at(row)->watchPath);
|
||||
if (removeFromFSWatcher)
|
||||
m_fsWatcher->removePath(m_pathList.at(row)->watchPath);
|
||||
delete m_pathList.takeAt(row);
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
bool ScanFoldersModel::removePath(const QString &path)
|
||||
bool ScanFoldersModel::removePath(const QString &path, bool removeFromFSWatcher)
|
||||
{
|
||||
const int row = findPathData(path);
|
||||
if (row == -1) return false;
|
||||
|
||||
removePath(row);
|
||||
removePath(row, removeFromFSWatcher);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScanFoldersModel::removeFromFSWatcher(const QStringList &watchPaths)
|
||||
{
|
||||
foreach (const QString &path, watchPaths)
|
||||
m_fsWatcher->removePath(path);
|
||||
}
|
||||
|
||||
bool ScanFoldersModel::downloadInWatchFolder(const QString &filePath) const
|
||||
{
|
||||
const int row = findPathData(QFileInfo(filePath).dir().path());
|
||||
|
||||
@@ -85,13 +85,16 @@ public:
|
||||
PathStatus updatePath(const QString &watchPath, const PathType& downloadType, const QString &downloadPath);
|
||||
// PRECONDITION: The paths must have been added with addPath() first.
|
||||
void addToFSWatcher(const QStringList &watchPaths);
|
||||
void removePath(int row);
|
||||
bool removePath(const QString &path);
|
||||
void removePath(int row, bool removeFromFSWatcher = true);
|
||||
bool removePath(const QString &path, bool removeFromFSWatcher = true);
|
||||
void removeFromFSWatcher(const QStringList &watchPaths);
|
||||
|
||||
void makePersistent();
|
||||
|
||||
private slots:
|
||||
public slots:
|
||||
void configure();
|
||||
|
||||
private slots:
|
||||
void addTorrentsToSession(const QStringList &pathList);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user