mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Fix possible crash with folder watching
This commit is contained in:
parent
8ccaaae085
commit
38cb4ccbd3
5 changed files with 32 additions and 23 deletions
|
@ -110,7 +110,7 @@ bool ScanFoldersModel::setData(const QModelIndex &index, const QVariant &value,
|
|||
return true;
|
||||
}
|
||||
|
||||
ScanFoldersModel::PathStatus ScanFoldersModel::addPath(const QString &path) {
|
||||
ScanFoldersModel::PathStatus ScanFoldersModel::addPath(const QString &path, bool download_at_path) {
|
||||
QDir dir(path);
|
||||
if (!dir.exists())
|
||||
return DoesNotExist;
|
||||
|
@ -126,6 +126,9 @@ ScanFoldersModel::PathStatus ScanFoldersModel::addPath(const QString &path) {
|
|||
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
||||
m_pathList << new PathData(canonicalPath);
|
||||
endInsertRows();
|
||||
// Set download at path
|
||||
setDownloadAtPath(m_pathList.size()-1, download_at_path);
|
||||
// Start scanning
|
||||
m_fsWatcher->addPath(canonicalPath);
|
||||
return Ok;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue