mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Improve coding style
This commit is contained in:
@@ -104,15 +104,18 @@ void RSSController::markAsReadAction()
|
||||
RSS::Item *item = RSS::Session::instance()->itemByPath(itemPath);
|
||||
if (!item) return;
|
||||
|
||||
if (!articleId.isNull()) {
|
||||
if (!articleId.isNull())
|
||||
{
|
||||
RSS::Feed *feed = qobject_cast<RSS::Feed *>(item);
|
||||
if (feed) {
|
||||
if (feed)
|
||||
{
|
||||
RSS::Article *article = feed->articleByGUID(articleId);
|
||||
if (article)
|
||||
article->markAsRead();
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
item->markAsRead();
|
||||
}
|
||||
}
|
||||
@@ -174,12 +177,14 @@ void RSSController::matchingArticlesAction()
|
||||
const RSS::AutoDownloadRule rule = RSS::AutoDownloader::instance()->ruleByName(ruleName);
|
||||
|
||||
QJsonObject jsonObj;
|
||||
for (const QString &feedURL : rule.feedURLs()) {
|
||||
for (const QString &feedURL : rule.feedURLs())
|
||||
{
|
||||
const RSS::Feed *feed = RSS::Session::instance()->feedByURL(feedURL);
|
||||
if (!feed) continue; // feed doesn't exist
|
||||
|
||||
QJsonArray matchingArticles;
|
||||
for (const RSS::Article *article : feed->articles()) {
|
||||
for (const RSS::Article *article : feed->articles())
|
||||
{
|
||||
if (rule.matches(article->data()))
|
||||
matchingArticles << article->title();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user