mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 21:21:24 -07:00
Improve coding style
This commit is contained in:
parent
acad35c5bc
commit
c41df9ffbd
147 changed files with 4454 additions and 2227 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue