Don't add the watch folder before the user closes the Preferences window.

This commit is contained in:
sledgehammer999 2016-01-01 15:50:35 +02:00
parent 56ca80eb78
commit 990e33a4b1
3 changed files with 20 additions and 4 deletions

View file

@ -418,6 +418,7 @@ void options_imp::saveOptions()
pref->useAdditionDialog(useAdditionDialog());
pref->additionDialogFront(checkAdditionDialogFront->isChecked());
pref->addTorrentsInPause(addTorrentsInPause());
ScanFoldersModel::instance()->addToFSWatcher(addedScanDirs);
ScanFoldersModel::instance()->makePersistent();
addedScanDirs.clear();
pref->setTorrentExportDir(getTorrentExportDir());
@ -1203,7 +1204,7 @@ void options_imp::on_addScanFolderButton_clicked()
const QString dir = QFileDialog::getExistingDirectory(this, tr("Add directory to scan"),
Utils::Fs::toNativePath(Utils::Fs::folderName(pref->getScanDirsLastPath())));
if (!dir.isEmpty()) {
const ScanFoldersModel::PathStatus status = ScanFoldersModel::instance()->addPath(dir, ScanFoldersModel::DOWNLOAD_IN_WATCH_FOLDER, QString());
const ScanFoldersModel::PathStatus status = ScanFoldersModel::instance()->addPath(dir, ScanFoldersModel::DOWNLOAD_IN_WATCH_FOLDER, QString(), false);
QString error;
switch (status) {
case ScanFoldersModel::AlreadyInList: