From: David ‘Bombe’ Roden Date: Wed, 30 Mar 2011 05:29:08 +0000 (+0200) Subject: Don’t show unknown Sones. X-Git-Tag: 0.6^2~38 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=bb49df4241c9ff7a5121b5f8c4d1e1c85f76dc86;p=Sone.git Don’t show unknown Sones. --- diff --git a/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java b/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java index b08b6e3..c0e6364 100644 --- a/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java +++ b/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java @@ -23,6 +23,7 @@ import java.util.List; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.util.collection.Pagination; +import net.pterodactylus.util.filter.Filters; import net.pterodactylus.util.number.Numbers; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; @@ -56,7 +57,7 @@ public class KnownSonesPage extends SoneTemplatePage { @Override protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException { super.processTemplate(request, templateContext); - List knownSones = new ArrayList(webInterface.getCore().getSones()); + List knownSones = Filters.filteredList(new ArrayList(webInterface.getCore().getSones()), Sone.EMPTY_SONE_FILTER); Collections.sort(knownSones, Sone.NICE_NAME_COMPARATOR); Pagination sonePagination = new Pagination(knownSones, 25).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("page"), 0)); templateContext.set("pagination", sonePagination);