diff --git a/src/rss/rssfeed.cpp b/src/rss/rssfeed.cpp index 926975739..01c90cce6 100644 --- a/src/rss/rssfeed.cpp +++ b/src/rss/rssfeed.cpp @@ -198,11 +198,11 @@ uint RssFeed::unreadCount() const{ return nbUnread; } -const RssArticleList RssFeed::articleList() const{ +RssArticleList RssFeed::articleList() const{ return m_articles.values(); } -const RssArticleList RssFeed::unreadArticleList() const { +RssArticleList RssFeed::unreadArticleList() const { RssArticleList unread_news; for (RssArticleHash::ConstIterator it = m_articles.begin(); it != m_articles.end(); it++) { if(!it.value()->isRead()) diff --git a/src/rss/rssfeed.h b/src/rss/rssfeed.h index eeb3ac27f..ea43ba30e 100644 --- a/src/rss/rssfeed.h +++ b/src/rss/rssfeed.h @@ -49,29 +49,29 @@ class RssFeed: public QObject, public RssFile { public: RssFeed(RssManager* manager, RssFolder* m_parent, const QString &url); virtual ~RssFeed(); - inline RssFolder* parent() const { return m_parent; } - void setParent(RssFolder* parent) { m_parent = parent; } + virtual RssFolder* parent() const { return m_parent; } + virtual void setParent(RssFolder* parent) { m_parent = parent; } void refresh(); - QString id() const { return m_url; } - void removeAllSettings(); + virtual QString id() const { return m_url; } + virtual void removeAllSettings(); bool itemAlreadyExists(const QString &guid) const; virtual void saveItemsToDisk(); void setLoading(bool val); bool isLoading() const; QString title() const; - void rename(const QString &alias); - QString displayName() const; + virtual void rename(const QString &alias); + virtual QString displayName() const; QString url() const; QString icon() const; bool hasCustomIcon() const; void setIconPath(const QString &pathHierarchy); RssArticlePtr getItem(const QString &guid) const; uint count() const; - void markAsRead(); - uint unreadCount() const; - const RssArticleList articleList() const; + virtual void markAsRead(); + virtual uint unreadCount() const; + virtual RssArticleList articleList() const; const RssArticleHash& articleHash() const { return m_articles; } - const RssArticleList unreadArticleList() const; + virtual RssArticleList unreadArticleList() const; private slots: void handleFinishedDownload(const QString& url, const QString &file_path); diff --git a/src/rss/rssfile.h b/src/rss/rssfile.h index 5f2d94154..b2390e458 100644 --- a/src/rss/rssfile.h +++ b/src/rss/rssfile.h @@ -59,9 +59,9 @@ public: virtual RssFolder* parent() const = 0; virtual void setParent(RssFolder* parent) = 0; virtual void refresh() = 0; + virtual RssArticleList articleList() const = 0; + virtual RssArticleList unreadArticleList() const = 0; virtual void removeAllSettings() = 0; - virtual const RssArticleList articleList() const = 0; - virtual const RssArticleList unreadArticleList() const = 0; virtual void saveItemsToDisk() = 0; QStringList pathHierarchy() const; }; diff --git a/src/rss/rssfolder.cpp b/src/rss/rssfolder.cpp index 5ea25353a..133aa1265 100644 --- a/src/rss/rssfolder.cpp +++ b/src/rss/rssfolder.cpp @@ -83,7 +83,7 @@ void RssFolder::refresh() { } } -const RssArticleList RssFolder::articleList() const { +RssArticleList RssFolder::articleList() const { RssArticleList news; for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { news << it.value()->articleList(); @@ -91,7 +91,7 @@ const RssArticleList RssFolder::articleList() const { return news; } -const RssArticleList RssFolder::unreadArticleList() const { +RssArticleList RssFolder::unreadArticleList() const { RssArticleList unread_news; for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { unread_news << it.value()->unreadArticleList(); diff --git a/src/rss/rssfolder.h b/src/rss/rssfolder.h index 7cdded3c8..8d2e58ff1 100644 --- a/src/rss/rssfolder.h +++ b/src/rss/rssfolder.h @@ -50,32 +50,32 @@ class RssFolder: public QObject, public RssFile { public: RssFolder(RssFolder *parent = 0, const QString &name = QString()); virtual ~RssFolder(); - inline RssFolder* parent() const { return m_parent; } - void setParent(RssFolder* parent) { m_parent = parent; } - unsigned int unreadCount() const; + virtual RssFolder* parent() const { return m_parent; } + virtual void setParent(RssFolder* parent) { m_parent = parent; } + virtual unsigned int unreadCount() const; RssFeedPtr addStream(RssManager* manager, const QString &url); RssFolderPtr addFolder(const QString &name); unsigned int getNbFeeds() const; RssFileList getContent() const; RssFeedList getAllFeeds() const; QHash getAllFeedsAsHash() const; - QString displayName() const; - QString id() const; + virtual QString displayName() const; + virtual QString id() const; bool hasChild(const QString &childId); - const RssArticleList articleList() const; - const RssArticleList unreadArticleList() const; - void removeAllSettings(); + virtual RssArticleList articleList() const; + virtual RssArticleList unreadArticleList() const; + virtual void removeAllSettings(); virtual void saveItemsToDisk(); void removeAllItems(); void renameChildFolder(const QString &old_name, const QString &new_name); RssFilePtr takeChild(const QString &childId); public slots: - void refresh(); + virtual void refresh(); void addFile(const RssFilePtr& item); void removeChild(const QString &childId); - void rename(const QString &new_name); - void markAsRead(); + virtual void rename(const QString &new_name); + virtual void markAsRead(); private: RssFolder *m_parent;