From 92b5ee58620b50020b3fe9a1a942ded9a0d59c9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 17 Nov 2010 21:45:46 +0100 Subject: [PATCH] =?utf8?q?Let=20the=20list=20notification=20dismiss=20itse?= =?utf8?q?lf=20automatically=20when=20it=E2=80=99s=20empty.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../java/net/pterodactylus/sone/notify/ListNotification.java | 3 +++ src/main/java/net/pterodactylus/sone/web/WebInterface.java | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java index 64c2ecb..423bea4 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java @@ -84,6 +84,9 @@ public class ListNotification extends TemplateNotification { */ public void remove(T element) { elements.remove(element); + if (elements.isEmpty()) { + dismiss(); + } touch(); } diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index db1880b..747b192 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -419,9 +419,6 @@ public class WebInterface implements CoreListener { @Override public void markSoneKnown(Sone sone) { newSoneNotification.remove(sone); - if (newSoneNotification.isEmpty()) { - newSoneNotification.dismiss(); - } } /** @@ -430,9 +427,6 @@ public class WebInterface implements CoreListener { @Override public void markPostKnown(Post post) { newPostNotification.remove(post); - if (newPostNotification.isEmpty()) { - newPostNotification.dismiss(); - } } /** @@ -441,9 +435,6 @@ public class WebInterface implements CoreListener { @Override public void markReplyKnown(Reply reply) { newReplyNotification.remove(reply); - if (newReplyNotification.isEmpty()) { - newReplyNotification.dismiss(); - } } /** -- 2.7.4