From b63e7e0b3a1429dabcae61e938e63145566a878a Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Fri, 10 Apr 2020 09:57:54 +0200 Subject: [PATCH] fix filter re-add data problem --- src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java | 1 + src/be/nikiroo/fanfix_swing/gui/browser/BasicTab.java | 2 ++ src/be/nikiroo/fanfix_swing/gui/browser/SourceTab.java | 1 + src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java | 1 + 4 files changed, 5 insertions(+) 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(); -- 2.27.0