Migrate everything to use the new Preferences class and not access directly the qbittorrent.ini file.

This commit is contained in:
sledgehammer999
2014-07-05 15:44:13 +03:00
parent da6ce859c0
commit d8d95d2195
44 changed files with 748 additions and 908 deletions

View File

@@ -42,12 +42,14 @@
#include "qtracker.h"
#include "preferences.h"
#include <vector>
using namespace libtorrent;
QTracker::QTracker(QObject *parent) :
QTcpServer(parent)
{
Q_ASSERT(Preferences().isTrackerEnabled());
Q_ASSERT(Preferences::instance()->isTrackerEnabled());
connect(this, SIGNAL(newConnection()), this, SLOT(handlePeerConnection()));
}
@@ -71,7 +73,7 @@ void QTracker::handlePeerConnection()
bool QTracker::start()
{
const int listen_port = Preferences().getTrackerPort();
const int listen_port = Preferences::instance()->getTrackerPort();
//
if (isListening()) {
if (serverPort() == listen_port) {