mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Added back folder watching to Web UI
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
|
||||
#include "eventmanager.h"
|
||||
#include "bittorrent.h"
|
||||
#include "scannedfoldersmodel.h"
|
||||
#include "misc.h"
|
||||
#include "preferences.h"
|
||||
//#include "proplistdelegate.h"
|
||||
@@ -129,8 +130,23 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
|
||||
Preferences::setTempPathEnabled(m["temp_path_enabled"].toBool());
|
||||
if(m.contains("temp_path"))
|
||||
Preferences::setTempPath(m["temp_path"].toString());
|
||||
if(m.contains("scan_dirs"))
|
||||
Preferences::setScanDirs(m["scan_dirs"].toStringList());
|
||||
if(m.contains("scan_dirs")) {
|
||||
QStringList old_folders = Preferences::getScanDirs();
|
||||
QStringList new_folders = m["scan_dirs"].toStringList();
|
||||
foreach(const QString &old_folder, old_folders) {
|
||||
// Update deleted folders
|
||||
if(!new_folders.contains(old_folder)) {
|
||||
BTSession->getScanFoldersModel()->removePath(old_folder);
|
||||
}
|
||||
}
|
||||
foreach(const QString &new_folder, new_folders) {
|
||||
// Update new folders
|
||||
if(!old_folders.contains(new_folder)) {
|
||||
BTSession->getScanFoldersModel()->addPath(new_folder);
|
||||
}
|
||||
}
|
||||
Preferences::setScanDirs(new_folders);
|
||||
}
|
||||
if(m.contains("download_in_scan_dirs"))
|
||||
Preferences::setDownloadInScanDirs(m["download_in_scan_dirs"].toList());
|
||||
if(m.contains("export_dir"))
|
||||
|
||||
Reference in New Issue
Block a user