Changeset View
Changeset View
Standalone View
Standalone View
src/attica/atticaprovider.cpp
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Line(s) | 265 | { | |||
---|---|---|---|---|---|
268 | } | 268 | } | ||
269 | 269 | | |||
270 | ListJob<Content> *listJob = static_cast<ListJob<Content>*>(job); | 270 | ListJob<Content> *listJob = static_cast<ListJob<Content>*>(job); | ||
271 | Content::List contents = listJob->itemList(); | 271 | Content::List contents = listJob->itemList(); | ||
272 | 272 | | |||
273 | EntryInternal::List entries; | 273 | EntryInternal::List entries; | ||
274 | TagsFilterChecker checker(tagFilter()); | 274 | TagsFilterChecker checker(tagFilter()); | ||
275 | TagsFilterChecker downloadschecker(downloadTagFilter()); | 275 | TagsFilterChecker downloadschecker(downloadTagFilter()); | ||
276 | Q_FOREACH (const Content &content, contents) { | 276 | for (const Content &content : contents) { | ||
277 | if (!content.isValid()) { | ||||
apol: Maybe it would be easier to read if we had a `if (!content.isValid()) continue; ...`. | |||||
Hmm... the patch certainly would, i'll swap that around a bit. Generally don't like negations too much if i can avoid them, hunting exclamation marks just gets tiring after a while, but yeah, smaller patch is good anyway :) leinir: Hmm... the patch certainly would, i'll swap that around a bit. Generally don't like negations… | |||||
278 | qCDebug(KNEWSTUFFCORE) << "Filtered out an invalid entry. This suggests something is not right on the originating server. Please contact the administrators of" << name() << "and inform them there is an issue with content in the category or categories" << mCurrentRequest.categories; | ||||
279 | continue; | ||||
280 | } | ||||
277 | if (checker.filterAccepts(content.tags())) { | 281 | if (checker.filterAccepts(content.tags())) { | ||
278 | bool filterAcceptsDownloads = true; | 282 | bool filterAcceptsDownloads = true; | ||
279 | if (content.downloads() > 0) { | 283 | if (content.downloads() > 0) { | ||
280 | filterAcceptsDownloads = false; | 284 | filterAcceptsDownloads = false; | ||
281 | for (const Attica::DownloadDescription &dli : content.downloadUrlDescriptions()) { | 285 | for (const Attica::DownloadDescription &dli : content.downloadUrlDescriptions()) { | ||
282 | if (downloadschecker.filterAccepts(dli.tags())) { | 286 | if (downloadschecker.filterAccepts(dli.tags())) { | ||
283 | filterAcceptsDownloads = true; | 287 | filterAcceptsDownloads = true; | ||
284 | break; | 288 | break; | ||
▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines |
Maybe it would be easier to read if we had a if (!content.isValid()) continue; ....