Started work on the new RSS feed downloader (WIP)

This commit is contained in:
Christophe Dumez
2010-10-31 12:35:07 +00:00
parent a2c19302cb
commit 6b7af5b464
94 changed files with 8342 additions and 4909 deletions

View File

@@ -40,27 +40,29 @@ class QBtSession;
class EventManager : public QObject
{
Q_OBJECT
private:
QHash<QString, QVariantMap> event_list;
QBtSession* BTSession;
Q_OBJECT
Q_DISABLE_COPY(EventManager)
protected:
void update(QVariantMap event);
private:
QHash<QString, QVariantMap> event_list;
QBtSession* BTSession;
public:
EventManager(QObject *parent, QBtSession* BTSession);
QList<QVariantMap> getEventList() const;
QVariantMap getPropGeneralInfo(QString hash) const;
QList<QVariantMap> getPropTrackersInfo(QString hash) const;
QList<QVariantMap> getPropFilesInfo(QString hash) const;
QVariantMap getGlobalPreferences() const;
void setGlobalPreferences(QVariantMap m) const;
protected:
void update(QVariantMap event);
public slots:
void addedTorrent(QTorrentHandle& h);
void deletedTorrent(QString hash);
void modifiedTorrent(QTorrentHandle h);
public:
EventManager(QObject *parent, QBtSession* BTSession);
QList<QVariantMap> getEventList() const;
QVariantMap getPropGeneralInfo(QString hash) const;
QList<QVariantMap> getPropTrackersInfo(QString hash) const;
QList<QVariantMap> getPropFilesInfo(QString hash) const;
QVariantMap getGlobalPreferences() const;
void setGlobalPreferences(QVariantMap m) const;
public slots:
void addedTorrent(QTorrentHandle& h);
void deletedTorrent(QString hash);
void modifiedTorrent(QTorrentHandle h);
};
#endif

View File

@@ -42,51 +42,53 @@ class QBtSession;
class HttpConnection : public QObject
{
Q_OBJECT
private:
QTcpSocket *socket;
HttpServer *parent;
QBtSession *BTSession;
Q_OBJECT
Q_DISABLE_COPY(HttpConnection)
protected:
HttpRequestParser parser;
HttpResponseGenerator generator;
private:
QTcpSocket *socket;
HttpServer *parent;
QBtSession *BTSession;
protected slots:
void write();
void respond();
void respondJson();
void respondGenPropertiesJson(QString hash);
void respondTrackersPropertiesJson(QString hash);
void respondFilesPropertiesJson(QString hash);
void respondPreferencesJson();
void respondGlobalTransferInfoJson();
void respondCommand(QString command);
void respondNotFound();
void processDownloadedFile(QString, QString);
void handleDownloadFailure(QString, QString);
void recheckTorrent(QString hash);
void recheckAllTorrents();
protected:
HttpRequestParser parser;
HttpResponseGenerator generator;
public:
HttpConnection(QTcpSocket *socket, QBtSession* BTSession, HttpServer *parent);
~HttpConnection();
QString translateDocument(QString data);
protected slots:
void write();
void respond();
void respondJson();
void respondGenPropertiesJson(QString hash);
void respondTrackersPropertiesJson(QString hash);
void respondFilesPropertiesJson(QString hash);
void respondPreferencesJson();
void respondGlobalTransferInfoJson();
void respondCommand(QString command);
void respondNotFound();
void processDownloadedFile(QString, QString);
void handleDownloadFailure(QString, QString);
void recheckTorrent(QString hash);
void recheckAllTorrents();
private slots:
void read();
public:
HttpConnection(QTcpSocket *socket, QBtSession* BTSession, HttpServer *parent);
~HttpConnection();
QString translateDocument(QString data);
signals:
void UrlReadyToBeDownloaded(QString url);
void MagnetReadyToBeDownloaded(QString uri);
void torrentReadyToBeDownloaded(QString, bool, QString, bool);
void deleteTorrent(QString hash, bool permanently);
void resumeTorrent(QString hash);
void pauseTorrent(QString hash);
void increasePrioTorrent(QString hash);
void decreasePrioTorrent(QString hash);
void resumeAllTorrents();
void pauseAllTorrents();
private slots:
void read();
signals:
void UrlReadyToBeDownloaded(QString url);
void MagnetReadyToBeDownloaded(QString uri);
void torrentReadyToBeDownloaded(QString, bool, QString, bool);
void deleteTorrent(QString hash, bool permanently);
void resumeTorrent(QString hash);
void pauseTorrent(QString hash);
void increasePrioTorrent(QString hash);
void decreasePrioTorrent(QString hash);
void resumeAllTorrents();
void pauseAllTorrents();
};
#endif

View File

@@ -46,6 +46,7 @@ const int MAX_AUTH_FAILED_ATTEMPTS = 5;
class HttpServer : public QTcpServer {
Q_OBJECT
Q_DISABLE_COPY(HttpServer)
public:
HttpServer(QBtSession *BTSession, int msec, QObject* parent = 0);