Skip to content

Commit b8f372e

Browse files
committed
- DisplayHostViewController:
- fix comment typo - exclude svgs from pagination as they are currently shown via QuickLook, which uses a Remote UI view that doesn't work well with pagination or hover gesture detection - addresses #1453 (comment)
1 parent f8d634b commit b8f372e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

ownCloud/Client/Viewer/DisplayHostViewController.swift

+13-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class DisplayHostViewController: UIPageViewController {
3030
}
3131

3232
// MARK: - Constants
33-
let mediaFilterRegexp: String = "\\A(((image|audio|video)/*))" // Filters all the mime types that are images (incluiding gif and svg)
33+
let mediaFilterRegexp: String = "\\A(((image|audio|video)/*))" // Filters all the mime types that are images (including gif and svg)
3434

3535
// MARK: - Instance Variables
3636
public var clientContext : ClientContext?
@@ -367,9 +367,19 @@ class DisplayHostViewController: UIPageViewController {
367367
}
368368

369369
// MARK: - Filters
370+
private func filtersMatch(item: OCItem?) -> Bool {
371+
if let mimeType = item?.mimeType,
372+
!mimeType.hasPrefix("image/svg"),
373+
mimeType.matches(regExp: mediaFilterRegexp) {
374+
return true
375+
}
376+
377+
return false
378+
}
379+
370380
private func applyMediaFilesFilter(items: [OCItem]) -> [OCItem] {
371-
if initialItem.mimeType?.matches(regExp: mediaFilterRegexp) ?? false {
372-
let filteredItems = items.filter({$0.type != .collection && $0.mimeType?.matches(regExp: self.mediaFilterRegexp) ?? false})
381+
if filtersMatch(item: initialItem) {
382+
let filteredItems = items.filter({$0.type != .collection && filtersMatch(item: $0)})
373383
return filteredItems
374384
} else {
375385
let filteredItems = items.filter({$0.type != .collection && $0.fileID == self.initialItem.fileID})

0 commit comments

Comments
 (0)