Rss code clean up

This commit is contained in:
Christophe Dumez 2011-01-27 19:28:05 +00:00
parent 7616c22897
commit e94769b58b
2 changed files with 20 additions and 20 deletions

View file

@ -40,9 +40,9 @@ RssManager* RssManager::m_instance = 0;
RssManager::RssManager(): RssFolder() { RssManager::RssManager(): RssFolder() {
m_rssDownloader = new DownloadThread(this); m_rssDownloader = new DownloadThread(this);
connect(&newsRefresher, SIGNAL(timeout()), this, SLOT(refresh())); connect(&m_refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
refreshInterval = RssSettings().getRSSRefreshInterval(); m_refreshInterval = RssSettings().getRSSRefreshInterval();
newsRefresher.start(refreshInterval*60000); m_refreshTimer.start(m_refreshInterval*60000);
} }
RssManager::~RssManager(){ RssManager::~RssManager(){
@ -53,11 +53,11 @@ RssManager::~RssManager(){
qDebug("RSSManager deleted"); qDebug("RSSManager deleted");
} }
void RssManager::updateRefreshInterval(unsigned int val){ void RssManager::updateRefreshInterval(uint val){
if(refreshInterval != val) { if(m_refreshInterval != val) {
refreshInterval = val; m_refreshInterval = val;
newsRefresher.start(refreshInterval*60000); m_refreshTimer.start(m_refreshInterval*60000);
qDebug("New RSS refresh interval is now every %dmin", refreshInterval); qDebug("New RSS refresh interval is now every %dmin", m_refreshInterval);
} }
} }
@ -94,11 +94,11 @@ void RssManager::loadStreamList() {
qDebug("NB RSS streams loaded: %d", streamsUrl.size()); qDebug("NB RSS streams loaded: %d", streamsUrl.size());
} }
void RssManager::forwardFeedInfosChanged(QString url, QString aliasOrUrl, unsigned int nbUnread) { void RssManager::forwardFeedInfosChanged(const QString &url, const QString &display_name, uint nbUnread) {
emit feedInfosChanged(url, aliasOrUrl, nbUnread); emit feedInfosChanged(url, display_name, nbUnread);
} }
void RssManager::forwardFeedIconChanged(QString url, QString icon_path) { void RssManager::forwardFeedIconChanged(const QString &url, const QString &icon_path) {
emit feedIconChanged(url, icon_path); emit feedIconChanged(url, icon_path);
} }
@ -114,7 +114,7 @@ void RssManager::moveFile(RssFile* file, RssFolder* dest_folder) {
} }
} }
void RssManager::saveStreamList(){ void RssManager::saveStreamList() const {
QStringList streamsUrl; QStringList streamsUrl;
QStringList aliases; QStringList aliases;
const QList<RssFeed*> streams = getAllFeeds(); const QList<RssFeed*> streams = getAllFeeds();

View file

@ -53,19 +53,19 @@ public:
public slots: public slots:
void loadStreamList(); void loadStreamList();
void saveStreamList(); void saveStreamList() const;
void forwardFeedInfosChanged(QString url, QString aliasOrUrl, unsigned int nbUnread); void forwardFeedInfosChanged(const QString &url, const QString &aliasOrUrl, uint nbUnread);
void forwardFeedIconChanged(QString url, QString icon_path); void forwardFeedIconChanged(const QString &url, const QString &icon_path);
void moveFile(RssFile* file, RssFolder* dest_folder); void moveFile(RssFile* file, RssFolder* dest_folder);
void updateRefreshInterval(unsigned int val); void updateRefreshInterval(uint val);
signals: signals:
void feedInfosChanged(QString url, QString aliasOrUrl, unsigned int nbUnread); void feedInfosChanged(const QString &url, const QString &display_name, uint nbUnread);
void feedIconChanged(QString url, QString icon_path); void feedIconChanged(const QString &url, const QString &icon_path);
private: private:
QTimer newsRefresher; QTimer m_refreshTimer;
unsigned int refreshInterval; uint m_refreshInterval;
DownloadThread *m_rssDownloader; DownloadThread *m_rssDownloader;
}; };