fix filter re-add data problem
authorNiki Roo <niki@nikiroo.be>
Fri, 10 Apr 2020 07:57:54 +0000 (09:57 +0200)
committerNiki Roo <niki@nikiroo.be>
Fri, 10 Apr 2020 07:57:54 +0000 (09:57 +0200)
src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java
src/be/nikiroo/fanfix_swing/gui/browser/BasicTab.java
src/be/nikiroo/fanfix_swing/gui/browser/SourceTab.java
src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java

index 0323b770ab56ffa3c1407a3eb240d89b42cbd827..d0e7ca906f6e32b5b838bc12ca7cd6ed8ddb8b95 100644 (file)
@@ -20,6 +20,7 @@ public class AuthorTab extends BasicTab<List<String>> {
 
        @Override
        protected void fillData(List<String> data) {
+               data.clear();
                try {
                        List<String> authors = Instance.getInstance().getLibrary()
                                        .getAuthors();
index e89acc36d3dd63e468eb10ec3595eb469693d94f..9b2bf789ac8ab05a75ae89c3a1b67a65fb91ba14 100644 (file)
@@ -199,6 +199,8 @@ public abstract class BasicTab<T> 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);
index 8ac5c1ef96ab4c56b6bd1a98a462d87693bb3891..a0006b4de4c088e75e1296ee596662721944de7c 100644 (file)
@@ -20,6 +20,7 @@ public class SourceTab extends BasicTab<Map<String, List<String>>> {
 
        @Override
        protected void fillData(Map<String, List<String>> data) {
+               data.clear();
                try {
                        Map<String, List<String>> sourcesGrouped = Instance.getInstance()
                                        .getLibrary().getSourcesGrouped();
index 49fcc27f609b7706e8ae4a9a75caac5e5bbf1c4f..2d40eab4ed6b0ce7bd0f67fbc5d08f69de600856 100644 (file)
@@ -22,6 +22,7 @@ public class TagsTab extends BasicTab<List<String>> {
 
        @Override
        protected void fillData(List<String> data) {
+               data.clear();
                try {
                        MetaResultList metas = Instance.getInstance().getLibrary()
                                        .getList();