mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 16:53:08 -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
|
@ -308,6 +308,7 @@ options_imp::~options_imp()
|
|||
qDebug("-> destructing Options");
|
||||
foreach (const QString &path, addedScanDirs)
|
||||
ScanFoldersModel::instance()->removePath(path);
|
||||
ScanFoldersModel::instance()->configure(); // reloads "removed" paths
|
||||
delete scrollArea_advanced->layout();
|
||||
delete advancedSettings;
|
||||
}
|
||||
|
@ -418,8 +419,10 @@ void options_imp::saveOptions()
|
|||
pref->useAdditionDialog(useAdditionDialog());
|
||||
pref->additionDialogFront(checkAdditionDialogFront->isChecked());
|
||||
pref->addTorrentsInPause(addTorrentsInPause());
|
||||
ScanFoldersModel::instance()->removeFromFSWatcher(removedScanDirs);
|
||||
ScanFoldersModel::instance()->addToFSWatcher(addedScanDirs);
|
||||
ScanFoldersModel::instance()->makePersistent();
|
||||
removedScanDirs.clear();
|
||||
addedScanDirs.clear();
|
||||
pref->setTorrentExportDir(getTorrentExportDir());
|
||||
pref->setFinishedTorrentExportDir(getFinishedTorrentExportDir());
|
||||
|
@ -1236,7 +1239,11 @@ void options_imp::on_removeScanFolderButton_clicked()
|
|||
if (selected.isEmpty())
|
||||
return;
|
||||
Q_ASSERT(selected.count() == ScanFoldersModel::instance()->columnCount());
|
||||
ScanFoldersModel::instance()->removePath(selected.first().row());
|
||||
foreach (const QModelIndex &index, selected) {
|
||||
if (index.column() == ScanFoldersModel::WATCH)
|
||||
removedScanDirs << index.data().toString();
|
||||
}
|
||||
ScanFoldersModel::instance()->removePath(selected.first().row(), false);
|
||||
}
|
||||
|
||||
void options_imp::handleScanFolderViewSelectionChanged()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue