Changeset View
Changeset View
Standalone View
Standalone View
libdiscover/backends/KNSBackend/KNSResource.cpp
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Line(s) | 169 | if (value.isValid() && !value.isEmpty()) | |||
---|---|---|---|---|---|
170 | list << value; | 170 | list << value; | ||
171 | else if (!fallback.isEmpty()) | 171 | else if (!fallback.isEmpty()) | ||
172 | appendIfValid(list, fallback); | 172 | appendIfValid(list, fallback); | ||
173 | } | 173 | } | ||
174 | 174 | | |||
175 | void KNSResource::fetchScreenshots() | 175 | void KNSResource::fetchScreenshots() | ||
176 | { | 176 | { | ||
177 | QList<QUrl> preview; | 177 | QList<QUrl> preview; | ||
178 | QUrl tempUrl; | ||||
179 | | ||||
178 | appendIfValid(preview, QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall1))); | 180 | appendIfValid(preview, QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall1))); | ||
179 | appendIfValid(preview, QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall2))); | 181 | | ||
180 | appendIfValid(preview, QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall3))); | 182 | tempUrl = QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall2)); | ||
183 | if (!preview.contains(tempUrl)) { | ||||
184 | appendIfValid(preview, tempUrl); | ||||
185 | } | ||||
186 | | ||||
187 | tempUrl = QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall3)); | ||||
188 | if (!preview.contains(tempUrl)) { | ||||
189 | appendIfValid(preview, tempUrl); | ||||
190 | } | ||||
181 | 191 | | |||
182 | QList<QUrl> screenshots; | 192 | QList<QUrl> screenshots; | ||
183 | appendIfValid(screenshots, QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewBig1)), QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall1))); | 193 | appendIfValid(screenshots, QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewBig1)), QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall1))); | ||
184 | appendIfValid(screenshots, QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewBig2)), QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall2))); | 194 | | ||
185 | appendIfValid(screenshots, QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewBig3)), QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewSmall3))); | 195 | tempUrl = QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewBig2)); | ||
196 | if (!screenshots.contains(tempUrl)) { | ||||
197 | appendIfValid(screenshots, tempUrl); | ||||
198 | } | ||||
199 | | ||||
200 | tempUrl = QUrl(m_entry.previewUrl(KNSCore::EntryInternal::PreviewBig3)); | ||||
201 | if (!screenshots.contains(tempUrl)) { | ||||
202 | appendIfValid(screenshots, tempUrl); | ||||
203 | } | ||||
186 | 204 | | |||
187 | emit screenshotsFetched(preview, screenshots); | 205 | emit screenshotsFetched(preview, screenshots); | ||
188 | } | 206 | } | ||
189 | 207 | | |||
190 | void KNSResource::fetchChangelog() | 208 | void KNSResource::fetchChangelog() | ||
191 | { | 209 | { | ||
192 | emit changelogFetched(m_entry.changelog()); | 210 | emit changelogFetched(m_entry.changelog()); | ||
193 | } | 211 | } | ||
Show All 30 Lines |