Browse Source

Rss code clean up

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
e94769b58b
  1. 24
      src/rss/rssmanager.cpp
  2. 16
      src/rss/rssmanager.h

24
src/rss/rssmanager.cpp

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

16
src/rss/rssmanager.h

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

Loading…
Cancel
Save