mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Use new libtorrent-1.1 settings API
This commit is contained in:
parent
b2cb473b63
commit
b5fe749f0b
12 changed files with 536 additions and 286 deletions
|
@ -39,6 +39,7 @@
|
|||
#include <QTranslator>
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/net/portforwarder.h"
|
||||
#include "base/net/proxyconfigurationmanager.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/scanfoldersmodel.h"
|
||||
|
@ -88,7 +89,7 @@ QByteArray prefjson::getPreferences()
|
|||
// Connection
|
||||
// Listening Port
|
||||
data["listen_port"] = session->port();
|
||||
data["upnp"] = pref->isUPnPEnabled();
|
||||
data["upnp"] = Net::PortForwarder::instance()->isEnabled();
|
||||
data["random_port"] = session->useRandomPort();
|
||||
// Connections Limits
|
||||
data["max_connec"] = session->maxConnections();
|
||||
|
@ -268,7 +269,7 @@ void prefjson::setPreferences(const QString& json)
|
|||
if (m.contains("listen_port"))
|
||||
session->setPort(m["listen_port"].toInt());
|
||||
if (m.contains("upnp"))
|
||||
pref->setUPnPEnabled(m["upnp"].toBool());
|
||||
Net::PortForwarder::instance()->setEnabled(m["upnp"].toBool());
|
||||
if (m.contains("random_port"))
|
||||
session->setUseRandomPort(m["random_port"].toBool());
|
||||
// Connections Limits
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue