qBittorrent
|
#include <rss_feed.h>
Signals | |
void | iconLoaded (Feed *feed=nullptr) |
void | titleChanged (Feed *feed=nullptr) |
void | stateChanged (Feed *feed=nullptr) |
Signals inherited from RSS::Item | |
void | pathChanged (Item *item=nullptr) |
void | unreadCountChanged (Item *item=nullptr) |
void | aboutToBeDestroyed (Item *item=nullptr) |
void | newArticle (Article *article) |
void | articleRead (Article *article) |
void | articleAboutToBeRemoved (Article *article) |
Public Member Functions | |
QList< Article * > | articles () const override |
int | unreadCount () const override |
void | markAsRead () override |
void | refresh () override |
QUuid | uid () const |
QString | url () const |
QString | title () const |
QString | lastBuildDate () const |
bool | hasError () const |
bool | isLoading () const |
Article * | articleByGUID (const QString &guid) const |
QString | iconPath () const |
QJsonValue | toJsonValue (bool withData=false) const override |
Public Member Functions inherited from RSS::Item | |
QString | path () const |
QString | name () const |
Private Slots | |
void | handleSessionProcessingEnabledChanged (bool enabled) |
void | handleMaxArticlesPerFeedChanged (int n) |
void | handleIconDownloadFinished (const Net::DownloadResult &result) |
void | handleDownloadFinished (const Net::DownloadResult &result) |
void | handleParsingFinished (const Private::ParsingResult &result) |
void | handleArticleRead (Article *article) |
Private Member Functions | |
Feed (const QUuid &uid, const QString &url, const QString &path, Session *session) | |
~Feed () override | |
void | timerEvent (QTimerEvent *event) override |
void | cleanup () override |
void | load () |
void | loadArticles (const QByteArray &data) |
void | loadArticlesLegacy () |
void | store () |
void | storeDeferred () |
bool | addArticle (Article *article) |
void | removeOldestArticle () |
void | increaseUnreadCount () |
void | decreaseUnreadCount () |
void | downloadIcon () |
int | updateArticles (const QList< QVariantHash > &loadedArticles) |
Private Attributes | |
Session * | m_session |
Private::Parser * | m_parser |
const QUuid | m_uid |
const QString | m_url |
QString | m_title |
QString | m_lastBuildDate |
bool | m_hasError = false |
bool | m_isLoading = false |
QHash< QString, Article * > | m_articles |
QList< Article * > | m_articlesByDate |
int | m_unreadCount = 0 |
QString | m_iconPath |
QString | m_dataFileName |
QBasicTimer | m_savingTimer |
bool | m_dirty = false |
Net::DownloadHandler * | m_downloadHandler = nullptr |
Friends | |
class | Session |
Additional Inherited Members | |
Static Public Member Functions inherited from RSS::Item | |
static bool | isValidPath (const QString &path) |
static QString | joinPath (const QString &path1, const QString &path2) |
static QStringList | expandPath (const QString &path) |
static QString | parentPath (const QString &path) |
static QString | relativeName (const QString &path) |
Static Public Attributes inherited from RSS::Item | |
static const QChar | PathSeparator |
Protected Member Functions inherited from RSS::Item | |
Item (const QString &path) | |
~Item () override | |
Definition at line 59 of file rss_feed.h.
|
private |
Definition at line 64 of file rss_feed.cpp.
References RSS::Session::dataFileStorage(), downloadIcon(), RSS::Private::Parser::finished(), Net::ServiceID::fromURL(), handleMaxArticlesPerFeedChanged(), handleParsingFinished(), handleSessionProcessingEnabledChanged(), Net::DownloadManager::instance(), RSS::Session::isProcessingEnabled(), load(), m_dataFileName, m_iconPath, m_lastBuildDate, m_parser, m_session, m_uid, m_url, RSS::Session::maxArticlesPerFeedChanged(), RSS::Session::processingStateChanged(), Net::DownloadManager::registerSequentialService(), AsyncFileStorage::storageDir(), Utils::Fs::toUniformPath(), Utils::Fs::toValidFileSystemName(), and RSS::Session::workingThread().
|
overrideprivate |
Definition at line 100 of file rss_feed.cpp.
References RSS::Item::aboutToBeDestroyed().
|
private |
Definition at line 367 of file rss_feed.cpp.
References RSS::Article::articleDateRecentThan(), RSS::Article::date(), RSS::Article::guid(), handleArticleRead(), increaseUnreadCount(), RSS::Article::isRead(), m_articles, m_articlesByDate, m_dirty, m_session, RSS::Session::maxArticlesPerFeed(), RSS::Item::newArticle(), RSS::Article::read(), and removeOldestArticle().
Referenced by loadArticles(), and loadArticlesLegacy().
Article * Feed::articleByGUID | ( | const QString & | guid | ) | const |
Definition at line 179 of file rss_feed.cpp.
References m_articles.
Referenced by RSSController::markAsReadAction(), and updateArticles().
|
overridevirtual |
Implements RSS::Item.
Definition at line 105 of file rss_feed.cpp.
References m_articlesByDate.
Referenced by RSSController::matchingArticlesAction(), and updateArticles().
|
overrideprivatevirtual |
Implements RSS::Item.
Definition at line 550 of file rss_feed.cpp.
References RSS::Session::dataFileStorage(), Utils::Fs::forceRemove(), m_dataFileName, m_iconPath, m_session, and AsyncFileStorage::storageDir().
|
private |
Definition at line 416 of file rss_feed.cpp.
References m_unreadCount, and RSS::Item::unreadCountChanged().
Referenced by handleArticleRead(), and removeOldestArticle().
|
private |
Definition at line 424 of file rss_feed.cpp.
References Net::DownloadManager::download(), handleIconDownloadFinished(), Net::DownloadManager::instance(), m_iconPath, m_url, Utils::IO::saveToFile(), and url().
Referenced by Feed(), handleSessionProcessingEnabledChanged(), and refresh().
|
privateslot |
Definition at line 540 of file rss_feed.cpp.
References RSS::Item::articleRead(), decreaseUnreadCount(), m_dirty, and storeDeferred().
Referenced by addArticle().
|
privateslot |
Definition at line 204 of file rss_feed.cpp.
References Net::DownloadResult::data, Net::DownloadResult::errorString, LogMsg(), m_downloadHandler, m_hasError, m_isLoading, m_parser, RSS::Private::Parser::parse(), stateChanged(), Net::DownloadResult::status, Net::Success, Net::DownloadResult::url, and Log::WARNING.
Referenced by refresh().
|
privateslot |
Definition at line 191 of file rss_feed.cpp.
References iconLoaded(), Net::DownloadResult::status, and Net::Success.
Referenced by downloadIcon().
|
privateslot |
Definition at line 184 of file rss_feed.cpp.
References m_articlesByDate, and removeOldestArticle().
Referenced by Feed().
|
privateslot |
Definition at line 227 of file rss_feed.cpp.
References RSS::Private::ParsingResult::articles, RSS::Private::ParsingResult::error, RSS::Private::ParsingResult::lastBuildDate, LogMsg(), m_dirty, m_hasError, m_isLoading, m_lastBuildDate, m_title, m_url, stateChanged(), store(), title(), RSS::Private::ParsingResult::title, titleChanged(), updateArticles(), url(), and Log::WARNING.
Referenced by Feed().
|
privateslot |
Definition at line 530 of file rss_feed.cpp.
References downloadIcon(), m_session, and RSS::Session::processingStateChanged().
Referenced by Feed().
bool Feed::hasError | ( | ) | const |
Definition at line 199 of file rss_feed.cpp.
References m_hasError.
Referenced by FeedListWidget::handleFeedIconLoaded(), anonymous_namespace{feedlistwidget.cpp}::rssFeedIcon(), and toJsonValue().
|
signal |
Referenced by RSS::Session::addItem(), and handleIconDownloadFinished().
QString Feed::iconPath | ( | ) | const |
Definition at line 503 of file rss_feed.cpp.
References m_iconPath.
Referenced by anonymous_namespace{feedlistwidget.cpp}::rssFeedIcon().
|
private |
Definition at line 410 of file rss_feed.cpp.
References m_unreadCount, and RSS::Item::unreadCountChanged().
Referenced by addArticle().
bool Feed::isLoading | ( | ) | const |
Definition at line 164 of file rss_feed.cpp.
References m_isLoading.
Referenced by FeedListWidget::handleFeedIconLoaded(), anonymous_namespace{feedlistwidget.cpp}::rssFeedIcon(), and toJsonValue().
QString Feed::lastBuildDate | ( | ) | const |
Definition at line 169 of file rss_feed.cpp.
References m_lastBuildDate.
Referenced by toJsonValue().
|
private |
Definition at line 263 of file rss_feed.cpp.
References RSS::Session::dataFileStorage(), file(), loadArticles(), loadArticlesLegacy(), LogMsg(), m_dataFileName, m_dirty, m_session, AsyncFileStorage::storageDir(), store(), and Log::WARNING.
Referenced by Feed().
|
private |
Definition at line 286 of file rss_feed.cpp.
References addArticle(), LogMsg(), m_url, and Log::WARNING.
Referenced by load().
|
private |
Definition at line 325 of file rss_feed.cpp.
References addArticle(), Profile::applicationSettings(), asConst(), Profile::instance(), RSS::Article::KeyIsRead, RSS::Article::KeyLink, RSS::Article::KeyTorrentURL, and m_url.
Referenced by load().
|
overridevirtual |
Implements RSS::Item.
Definition at line 110 of file rss_feed.cpp.
References RSS::Item::articleRead(), asConst(), m_articles, m_dirty, m_unreadCount, store(), and RSS::Item::unreadCountChanged().
|
overridevirtual |
Implements RSS::Item.
Definition at line 132 of file rss_feed.cpp.
References Net::DownloadHandler::cancel(), Net::DownloadManager::download(), downloadIcon(), Net::DownloadHandler::finished(), handleDownloadFinished(), Net::DownloadManager::instance(), m_downloadHandler, m_iconPath, m_isLoading, m_url, and stateChanged().
Referenced by RSS::Session::addFeed().
|
private |
Definition at line 396 of file rss_feed.cpp.
References RSS::Item::articleAboutToBeRemoved(), decreaseUnreadCount(), m_articles, and m_articlesByDate.
Referenced by addArticle(), and handleMaxArticlesPerFeedChanged().
|
signal |
Referenced by RSS::Session::addItem(), handleDownloadFinished(), handleParsingFinished(), and refresh().
|
private |
Definition at line 347 of file rss_feed.cpp.
References asConst(), RSS::Session::dataFileStorage(), m_articles, m_dataFileName, m_dirty, m_savingTimer, m_session, and AsyncFileStorage::store().
Referenced by handleParsingFinished(), load(), markAsRead(), and timerEvent().
|
private |
Definition at line 361 of file rss_feed.cpp.
References m_savingTimer.
Referenced by handleArticleRead().
|
overrideprivate |
Definition at line 556 of file rss_feed.cpp.
References store().
QString Feed::title | ( | ) | const |
Definition at line 159 of file rss_feed.cpp.
References m_title.
Referenced by RSS::Session::handleFeedTitleChanged(), handleParsingFinished(), RSSController::matchingArticlesAction(), toJsonValue(), and AutomatedRssDownloader::updateMatchingArticles().
|
signal |
Referenced by RSS::Session::addItem(), and handleParsingFinished().
|
overridevirtual |
Implements RSS::Item.
Definition at line 508 of file rss_feed.cpp.
References asConst(), hasError(), isLoading(), KEY_ARTICLES(), KEY_HASERROR(), KEY_ISLOADING(), KEY_LASTBUILDDATE(), KEY_TITLE(), KEY_UID(), KEY_URL(), lastBuildDate(), m_articles, title(), anonymous_namespace{session.cpp}::toString(), uid(), and url().
QUuid Feed::uid | ( | ) | const |
Definition at line 149 of file rss_feed.cpp.
References m_uid.
Referenced by toJsonValue().
|
overridevirtual |
|
private |
Definition at line 435 of file rss_feed.cpp.
References articleByGUID(), articles(), RSS::Article::date(), RSS::Article::KeyDate, RSS::Article::KeyId, m_session, RSS::Session::maxArticlesPerFeed(), and anonymous_namespace{session.cpp}::toString().
Referenced by handleParsingFinished().
QString Feed::url | ( | ) | const |
Definition at line 154 of file rss_feed.cpp.
References m_url.
Referenced by AutomatedRssDownloader::addFeedArticlesToTree(), RSS::AutoDownloader::addJobForArticle(), downloadIcon(), RSS::Session::handleFeedTitleChanged(), handleParsingFinished(), and toJsonValue().
|
friend |
Definition at line 64 of file rss_feed.h.
|
private |
Definition at line 122 of file rss_feed.h.
Referenced by addArticle(), articleByGUID(), markAsRead(), removeOldestArticle(), store(), and toJsonValue().
|
private |
Definition at line 123 of file rss_feed.h.
Referenced by addArticle(), articles(), handleMaxArticlesPerFeedChanged(), and removeOldestArticle().
|
private |
|
private |
Definition at line 128 of file rss_feed.h.
Referenced by addArticle(), handleArticleRead(), handleParsingFinished(), load(), markAsRead(), and store().
|
private |
Definition at line 129 of file rss_feed.h.
Referenced by handleDownloadFinished(), and refresh().
|
private |
Definition at line 120 of file rss_feed.h.
Referenced by handleDownloadFinished(), handleParsingFinished(), and hasError().
|
private |
Definition at line 125 of file rss_feed.h.
Referenced by cleanup(), downloadIcon(), Feed(), iconPath(), and refresh().
|
private |
Definition at line 121 of file rss_feed.h.
Referenced by handleDownloadFinished(), handleParsingFinished(), isLoading(), and refresh().
|
private |
Definition at line 119 of file rss_feed.h.
Referenced by Feed(), handleParsingFinished(), and lastBuildDate().
|
private |
Definition at line 115 of file rss_feed.h.
Referenced by Feed(), and handleDownloadFinished().
|
private |
Definition at line 127 of file rss_feed.h.
Referenced by store(), and storeDeferred().
|
private |
Definition at line 114 of file rss_feed.h.
Referenced by addArticle(), cleanup(), Feed(), handleSessionProcessingEnabledChanged(), load(), store(), and updateArticles().
|
private |
Definition at line 118 of file rss_feed.h.
Referenced by handleParsingFinished(), and title().
|
private |
Definition at line 116 of file rss_feed.h.
|
private |
Definition at line 124 of file rss_feed.h.
Referenced by decreaseUnreadCount(), increaseUnreadCount(), markAsRead(), and unreadCount().
|
private |
Definition at line 117 of file rss_feed.h.
Referenced by downloadIcon(), Feed(), handleParsingFinished(), loadArticles(), loadArticlesLegacy(), refresh(), and url().