Browse Source

RSS: Correctly mark virtual functions

adaptive-webui-19844
Christophe Dumez 13 years ago
parent
commit
9acac03f14
  1. 4
      src/rss/rssfeed.cpp
  2. 20
      src/rss/rssfeed.h
  3. 4
      src/rss/rssfile.h
  4. 4
      src/rss/rssfolder.cpp
  5. 22
      src/rss/rssfolder.h

4
src/rss/rssfeed.cpp

@ -198,11 +198,11 @@ uint RssFeed::unreadCount() const{
return nbUnread; return nbUnread;
} }
const RssArticleList RssFeed::articleList() const{ RssArticleList RssFeed::articleList() const{
return m_articles.values(); return m_articles.values();
} }
const RssArticleList RssFeed::unreadArticleList() const { RssArticleList RssFeed::unreadArticleList() const {
RssArticleList unread_news; RssArticleList unread_news;
for (RssArticleHash::ConstIterator it = m_articles.begin(); it != m_articles.end(); it++) { for (RssArticleHash::ConstIterator it = m_articles.begin(); it != m_articles.end(); it++) {
if(!it.value()->isRead()) if(!it.value()->isRead())

20
src/rss/rssfeed.h

@ -49,29 +49,29 @@ class RssFeed: public QObject, public RssFile {
public: public:
RssFeed(RssManager* manager, RssFolder* m_parent, const QString &url); RssFeed(RssManager* manager, RssFolder* m_parent, const QString &url);
virtual ~RssFeed(); virtual ~RssFeed();
inline RssFolder* parent() const { return m_parent; } virtual RssFolder* parent() const { return m_parent; }
void setParent(RssFolder* parent) { m_parent = parent; } virtual void setParent(RssFolder* parent) { m_parent = parent; }
void refresh(); void refresh();
QString id() const { return m_url; } virtual QString id() const { return m_url; }
void removeAllSettings(); virtual void removeAllSettings();
bool itemAlreadyExists(const QString &guid) const; bool itemAlreadyExists(const QString &guid) const;
virtual void saveItemsToDisk(); virtual void saveItemsToDisk();
void setLoading(bool val); void setLoading(bool val);
bool isLoading() const; bool isLoading() const;
QString title() const; QString title() const;
void rename(const QString &alias); virtual void rename(const QString &alias);
QString displayName() const; virtual QString displayName() const;
QString url() const; QString url() const;
QString icon() const; QString icon() const;
bool hasCustomIcon() const; bool hasCustomIcon() const;
void setIconPath(const QString &pathHierarchy); void setIconPath(const QString &pathHierarchy);
RssArticlePtr getItem(const QString &guid) const; RssArticlePtr getItem(const QString &guid) const;
uint count() const; uint count() const;
void markAsRead(); virtual void markAsRead();
uint unreadCount() const; virtual uint unreadCount() const;
const RssArticleList articleList() const; virtual RssArticleList articleList() const;
const RssArticleHash& articleHash() const { return m_articles; } const RssArticleHash& articleHash() const { return m_articles; }
const RssArticleList unreadArticleList() const; virtual RssArticleList unreadArticleList() const;
private slots: private slots:
void handleFinishedDownload(const QString& url, const QString &file_path); void handleFinishedDownload(const QString& url, const QString &file_path);

4
src/rss/rssfile.h

@ -59,9 +59,9 @@ public:
virtual RssFolder* parent() const = 0; virtual RssFolder* parent() const = 0;
virtual void setParent(RssFolder* parent) = 0; virtual void setParent(RssFolder* parent) = 0;
virtual void refresh() = 0; virtual void refresh() = 0;
virtual RssArticleList articleList() const = 0;
virtual RssArticleList unreadArticleList() const = 0;
virtual void removeAllSettings() = 0; virtual void removeAllSettings() = 0;
virtual const RssArticleList articleList() const = 0;
virtual const RssArticleList unreadArticleList() const = 0;
virtual void saveItemsToDisk() = 0; virtual void saveItemsToDisk() = 0;
QStringList pathHierarchy() const; QStringList pathHierarchy() const;
}; };

4
src/rss/rssfolder.cpp

@ -83,7 +83,7 @@ void RssFolder::refresh() {
} }
} }
const RssArticleList RssFolder::articleList() const { RssArticleList RssFolder::articleList() const {
RssArticleList news; RssArticleList news;
for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) {
news << it.value()->articleList(); news << it.value()->articleList();
@ -91,7 +91,7 @@ const RssArticleList RssFolder::articleList() const {
return news; return news;
} }
const RssArticleList RssFolder::unreadArticleList() const { RssArticleList RssFolder::unreadArticleList() const {
RssArticleList unread_news; RssArticleList unread_news;
for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) {
unread_news << it.value()->unreadArticleList(); unread_news << it.value()->unreadArticleList();

22
src/rss/rssfolder.h

@ -50,32 +50,32 @@ class RssFolder: public QObject, public RssFile {
public: public:
RssFolder(RssFolder *parent = 0, const QString &name = QString()); RssFolder(RssFolder *parent = 0, const QString &name = QString());
virtual ~RssFolder(); virtual ~RssFolder();
inline RssFolder* parent() const { return m_parent; } virtual RssFolder* parent() const { return m_parent; }
void setParent(RssFolder* parent) { m_parent = parent; } virtual void setParent(RssFolder* parent) { m_parent = parent; }
unsigned int unreadCount() const; virtual unsigned int unreadCount() const;
RssFeedPtr addStream(RssManager* manager, const QString &url); RssFeedPtr addStream(RssManager* manager, const QString &url);
RssFolderPtr addFolder(const QString &name); RssFolderPtr addFolder(const QString &name);
unsigned int getNbFeeds() const; unsigned int getNbFeeds() const;
RssFileList getContent() const; RssFileList getContent() const;
RssFeedList getAllFeeds() const; RssFeedList getAllFeeds() const;
QHash<QString, RssFeedPtr> getAllFeedsAsHash() const; QHash<QString, RssFeedPtr> getAllFeedsAsHash() const;
QString displayName() const; virtual QString displayName() const;
QString id() const; virtual QString id() const;
bool hasChild(const QString &childId); bool hasChild(const QString &childId);
const RssArticleList articleList() const; virtual RssArticleList articleList() const;
const RssArticleList unreadArticleList() const; virtual RssArticleList unreadArticleList() const;
void removeAllSettings(); virtual void removeAllSettings();
virtual void saveItemsToDisk(); virtual void saveItemsToDisk();
void removeAllItems(); void removeAllItems();
void renameChildFolder(const QString &old_name, const QString &new_name); void renameChildFolder(const QString &old_name, const QString &new_name);
RssFilePtr takeChild(const QString &childId); RssFilePtr takeChild(const QString &childId);
public slots: public slots:
void refresh(); virtual void refresh();
void addFile(const RssFilePtr& item); void addFile(const RssFilePtr& item);
void removeChild(const QString &childId); void removeChild(const QString &childId);
void rename(const QString &new_name); virtual void rename(const QString &new_name);
void markAsRead(); virtual void markAsRead();
private: private:
RssFolder *m_parent; RssFolder *m_parent;

Loading…
Cancel
Save