From: Niki Roo Date: Fri, 10 Apr 2020 07:57:54 +0000 (+0200) Subject: fix filter re-add data problem X-Git-Tag: fanfix-swing-0.0.1~35 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=b63e7e0b3a1429dabcae61e938e63145566a878a;p=fanfix-swing.git fix filter re-add data problem --- diff --git a/src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java b/src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java index 0323b770..d0e7ca90 100644 --- a/src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java +++ b/src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java @@ -20,6 +20,7 @@ public class AuthorTab extends BasicTab> { @Override protected void fillData(List data) { + data.clear(); try { List authors = Instance.getInstance().getLibrary() .getAuthors(); diff --git a/src/be/nikiroo/fanfix_swing/gui/browser/BasicTab.java b/src/be/nikiroo/fanfix_swing/gui/browser/BasicTab.java index e89acc36..9b2bf789 100644 --- a/src/be/nikiroo/fanfix_swing/gui/browser/BasicTab.java +++ b/src/be/nikiroo/fanfix_swing/gui/browser/BasicTab.java @@ -199,6 +199,8 @@ public abstract class BasicTab extends ListenerPanel { protected abstract T createEmptyData(); + // beware: you should update it OR clean/re-add it, but previous data may + // still be there protected abstract void fillData(T data); protected abstract String keyToElement(String key); diff --git a/src/be/nikiroo/fanfix_swing/gui/browser/SourceTab.java b/src/be/nikiroo/fanfix_swing/gui/browser/SourceTab.java index 8ac5c1ef..a0006b4d 100644 --- a/src/be/nikiroo/fanfix_swing/gui/browser/SourceTab.java +++ b/src/be/nikiroo/fanfix_swing/gui/browser/SourceTab.java @@ -20,6 +20,7 @@ public class SourceTab extends BasicTab>> { @Override protected void fillData(Map> data) { + data.clear(); try { Map> sourcesGrouped = Instance.getInstance() .getLibrary().getSourcesGrouped(); diff --git a/src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java b/src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java index 49fcc27f..2d40eab4 100644 --- a/src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java +++ b/src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java @@ -22,6 +22,7 @@ public class TagsTab extends BasicTab> { @Override protected void fillData(List data) { + data.clear(); try { MetaResultList metas = Instance.getInstance().getLibrary() .getList();