diff --git a/src/GUI.cpp b/src/GUI.cpp index 130f092b6..4b02e7cb3 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -1575,7 +1575,7 @@ bool GUI::initWebUi(QString username, QString password, int port) httpServer->close(); } else - httpServer = new HttpServer(BTSession, 500, this); + httpServer = new HttpServer(BTSession, 1000, this); httpServer->setAuthorization(username, password); bool success = httpServer->listen(QHostAddress::Any, port); if (success) diff --git a/src/eventmanager.cpp b/src/eventmanager.cpp index 88d6075cc..98da70f82 100644 --- a/src/eventmanager.cpp +++ b/src/eventmanager.cpp @@ -32,7 +32,7 @@ EventManager::EventManager(QObject *parent, bittorrent *BTSession) void EventManager::update(QVariantMap event) { - revision++; + ++revision; events << QPair(revision, event); emit updated(); qDebug("Added the following event"); diff --git a/src/httpresponsegenerator.cpp b/src/httpresponsegenerator.cpp index f139f1bc7..c6b20eec1 100644 --- a/src/httpresponsegenerator.cpp +++ b/src/httpresponsegenerator.cpp @@ -20,7 +20,6 @@ #include "httpresponsegenerator.h" -#include void HttpResponseGenerator::setMessage(const QByteArray message) { diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 5cc81ea9b..74cc55d90 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -32,14 +32,16 @@ HttpServer::HttpServer(bittorrent *BTSession, int msec, QObject* parent) : QTcpS HttpServer::BTSession = BTSession; manager = new EventManager(this, BTSession); //add torrents - QStringList list = BTSession->getUnfinishedTorrents() + BTSession->getFinishedTorrents(); - QString hash; - foreach(hash, list) - { + QStringList list = BTSession->getUnfinishedTorrents(); + foreach(QString hash, list) { QTorrentHandle h = BTSession->getTorrentHandle(hash); - if(h.is_valid()) - manager->addedTorrent(h); + if(h.is_valid()) manager->addedTorrent(h); } + list = BTSession->getFinishedTorrents(); + foreach(QString hash, list) { + QTorrentHandle h = BTSession->getTorrentHandle(hash); + if(h.is_valid()) manager->addedTorrent(h); + } //connect BTSession to manager connect(BTSession, SIGNAL(addedTorrent(QTorrentHandle&)), manager, SLOT(addedTorrent(QTorrentHandle&))); connect(BTSession, SIGNAL(deletedTorrent(QString)), manager, SLOT(deletedTorrent(QString))); @@ -73,13 +75,16 @@ void HttpServer::newHttpConnection() void HttpServer::onTimer() { - QStringList list = BTSession->getUnfinishedTorrents() + BTSession->getFinishedTorrents(); - foreach(QString hash, list) - { + QStringList list = BTSession->getUnfinishedTorrents(); + foreach(QString hash, list) { QTorrentHandle h = BTSession->getTorrentHandle(hash); - if(h.is_valid()) - manager->modifiedTorrent(h); + if(h.is_valid()) manager->modifiedTorrent(h); } + list = BTSession->getFinishedTorrents(); + foreach(QString hash, list) { + QTorrentHandle h = BTSession->getTorrentHandle(hash); + if(h.is_valid()) manager->modifiedTorrent(h); + } } void HttpServer::setAuthorization(QString username, QString password)