mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
Remove watch folders permanently only if the user accepts the Preferences dialog.
This commit is contained in:
parent
9c88959651
commit
06be9edfe1
4 changed files with 26 additions and 8 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue