mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Redesign main core classes.
This commit is contained in:
@@ -30,15 +30,14 @@
|
||||
|
||||
#include "prefjson.h"
|
||||
#include "core/preferences.h"
|
||||
#include "qbtsession.h"
|
||||
#include "core/scannedfoldersmodel.h"
|
||||
#include "core/scanfoldersmodel.h"
|
||||
#include "core/fs_utils.h"
|
||||
|
||||
#include <libtorrent/version.hpp>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#include <QSslCertificate>
|
||||
#include <QSslKey>
|
||||
#endif
|
||||
#include <QStringList>
|
||||
#include <QTranslator>
|
||||
#include <QCoreApplication>
|
||||
#include "jsonutils.h"
|
||||
@@ -183,7 +182,7 @@ void prefjson::setPreferences(const QString& json)
|
||||
foreach (const QString &old_folder, old_folders) {
|
||||
// Update deleted folders
|
||||
if (!new_folders.contains(old_folder)) {
|
||||
QBtSession::instance()->getScanFoldersModel()->removePath(old_folder);
|
||||
ScanFoldersModel::instance()->removePath(old_folder);
|
||||
}
|
||||
}
|
||||
int i = 0;
|
||||
@@ -191,7 +190,7 @@ void prefjson::setPreferences(const QString& json)
|
||||
qDebug("New watched folder: %s", qPrintable(new_folder));
|
||||
// Update new folders
|
||||
if (!old_folders.contains(fsutils::fromNativePath(new_folder))) {
|
||||
QBtSession::instance()->getScanFoldersModel()->addPath(new_folder, download_at_path.at(i));
|
||||
ScanFoldersModel::instance()->addPath(new_folder, download_at_path.at(i));
|
||||
}
|
||||
++i;
|
||||
}
|
||||
@@ -337,5 +336,5 @@ void prefjson::setPreferences(const QString& json)
|
||||
if (m.contains("dyndns_domain"))
|
||||
pref->setDynDomainName(m["dyndns_domain"].toString());
|
||||
// Save preferences
|
||||
pref->save();
|
||||
pref->apply();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user