Big code clean up

This commit is contained in:
Christophe Dumez
2010-10-17 14:46:01 +00:00
parent f53fe96191
commit 290932e128
33 changed files with 465 additions and 527 deletions

View File

@@ -30,7 +30,7 @@
#include "feeddownloader.h"
FeedDownloaderDlg::FeedDownloaderDlg(QWidget *parent, QString feed_url, QString feed_name, Bittorrent* BTSession):
FeedDownloaderDlg::FeedDownloaderDlg(QWidget *parent, QString feed_url, QString feed_name, QBtSession* BTSession):
QDialog(parent), feed_url(feed_url), feed_name(feed_name), BTSession(BTSession), selected_filter(QString::null)
{
setupUi(this);

View File

@@ -52,7 +52,7 @@ class FeedDownloaderDlg : public QDialog, private Ui_FeedDownloader{
Q_OBJECT
public:
FeedDownloaderDlg(QWidget *parent, QString feed_url, QString feed_name, Bittorrent* BTSession);
FeedDownloaderDlg(QWidget *parent, QString feed_url, QString feed_name, QBtSession* BTSession);
~FeedDownloaderDlg();
protected slots:
@@ -78,7 +78,7 @@ private:
QString feed_url;
QString feed_name;
RssFilters filters;
Bittorrent *BTSession;
QBtSession *BTSession;
QString selected_filter; // name
};

View File

@@ -585,7 +585,7 @@ void RSSImp::updateRefreshInterval(unsigned int val) {
rssmanager->updateRefreshInterval(val);
}
RSSImp::RSSImp(Bittorrent *BTSession) : QWidget(), BTSession(BTSession){
RSSImp::RSSImp(QBtSession *BTSession) : QWidget(), BTSession(BTSession){
setupUi(this);
rssmanager = new RssManager(BTSession);

View File

@@ -36,7 +36,7 @@
#include "ui_rss.h"
class Bittorrent;
class QBtSession;
class FeedListWidget;
class QTreeWidgetItem;
class RssFolder;
@@ -46,7 +46,7 @@ class RSSImp : public QWidget, public Ui::RSS{
Q_OBJECT
public:
RSSImp(Bittorrent *BTSession);
RSSImp(QBtSession *BTSession);
~RSSImp();
public slots:
@@ -83,7 +83,7 @@ protected slots:
private:
RssManager *rssmanager;
Bittorrent *BTSession;
QBtSession *BTSession;
FeedListWidget *listStreams;
QTreeWidgetItem* previous_news;

View File

@@ -36,7 +36,7 @@
#include "rssarticle.h"
#include "feeddownloader.h"
RssFeed::RssFeed(RssFolder* parent, RssManager *rssmanager, Bittorrent *BTSession, QString _url): parent(parent), rssmanager(rssmanager), BTSession(BTSession), alias(""), iconPath(":/Icons/rss16.png"), refreshed(false), downloadFailure(false), currently_loading(false) {
RssFeed::RssFeed(RssFolder* parent, RssManager *rssmanager, QBtSession *BTSession, QString _url): parent(parent), rssmanager(rssmanager), BTSession(BTSession), alias(""), iconPath(":/Icons/rss16.png"), refreshed(false), downloadFailure(false), currently_loading(false) {
qDebug("RSSStream constructed");
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
url = QUrl(_url).toString();

View File

@@ -36,7 +36,7 @@
#include "rssfile.h"
class RssManager;
class Bittorrent;
class QBtSession;
class RssFeed: public RssFile, public QHash<QString, RssArticle*> {
Q_OBJECT
@@ -44,7 +44,7 @@ class RssFeed: public RssFile, public QHash<QString, RssArticle*> {
private:
RssFolder *parent;
RssManager *rssmanager;
Bittorrent *BTSession;
QBtSession *BTSession;
QString title;
QString link;
QString description;
@@ -63,7 +63,7 @@ public slots:
void setDownloadFailed();
public:
RssFeed(RssFolder* parent, RssManager *rssmanager, Bittorrent *BTSession, QString _url);
RssFeed(RssFolder* parent, RssManager *rssmanager, QBtSession *BTSession, QString _url);
~RssFeed();
RssFolder* getParent() const { return parent; }
void setParent(RssFolder* _parent) { parent = _parent; }

View File

@@ -35,7 +35,7 @@
#include "rssmanager.h"
#include "rssfeed.h"
RssFolder::RssFolder(RssFolder *parent, RssManager *rssmanager, Bittorrent *BTSession, QString name): parent(parent), rssmanager(rssmanager), BTSession(BTSession), name(name) {
RssFolder::RssFolder(RssFolder *parent, RssManager *rssmanager, QBtSession *BTSession, QString name): parent(parent), rssmanager(rssmanager), BTSession(BTSession), name(name) {
downloader = new downloadThread(this);
connect(downloader, SIGNAL(downloadFinished(QString, QString)), this, SLOT(processFinishedDownload(QString, QString)));
connect(downloader, SIGNAL(downloadFailure(QString, QString)), this, SLOT(handleDownloadFailure(QString, QString)));

View File

@@ -36,7 +36,7 @@
#include "rssfile.h"
class RssArticle;
class Bittorrent;
class QBtSession;
class downloadThread;
class RssManager;
class RssFeed;
@@ -45,7 +45,7 @@ class RssFolder: public RssFile, public QHash<QString, RssFile*> {
Q_OBJECT
public:
RssFolder(RssFolder *parent, RssManager *rssmanager, Bittorrent *BTSession, QString name);
RssFolder(RssFolder *parent, RssManager *rssmanager, QBtSession *BTSession, QString name);
~RssFolder();
RssFolder* getParent() const { return parent; }
void setParent(RssFolder* _parent) { parent = _parent; }
@@ -80,7 +80,7 @@ private:
RssFolder *parent;
RssManager *rssmanager;
downloadThread *downloader;
Bittorrent *BTSession;
QBtSession *BTSession;
QString name;
};

View File

@@ -34,7 +34,7 @@
#include "rssfeed.h"
#include "rssarticle.h"
RssManager::RssManager(Bittorrent *BTSession): RssFolder(0, this, BTSession, QString::null) {
RssManager::RssManager(QBtSession *BTSession): RssFolder(0, this, BTSession, QString::null) {
loadStreamList();
connect(&newsRefresher, SIGNAL(timeout()), this, SLOT(refreshAll()));
refreshInterval = Preferences::getRSSRefreshInterval();

View File

@@ -39,7 +39,7 @@ class RssManager: public RssFolder {
Q_OBJECT
public:
RssManager(Bittorrent *BTSession);
RssManager(QBtSession *BTSession);
~RssManager();
static void insertSortElem(QList<RssArticle*> &list, RssArticle *item);
static QList<RssArticle*> sortNewsList(const QList<RssArticle*>& news_list);
@@ -59,7 +59,7 @@ signals:
private:
QTimer newsRefresher;
unsigned int refreshInterval;
Bittorrent *BTSession;
QBtSession *BTSession;
};