X-Git-Url: https://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix_swing%2Fgui%2Fbook%2FBookPopup.java;h=42f7e3b7205ef1f6cc43af65eb96d5775cd2bef1;hb=2a03ecc0ae449a05763db2d47935a4c256cd092f;hp=0710549feb3112f1233261ed79f47e8cedd01681;hpb=59253323f07e6a67ef6c8e197fd1065a81c7069a;p=fanfix.git diff --git a/src/be/nikiroo/fanfix_swing/gui/book/BookPopup.java b/src/be/nikiroo/fanfix_swing/gui/book/BookPopup.java index 0710549..42f7e3b 100644 --- a/src/be/nikiroo/fanfix_swing/gui/book/BookPopup.java +++ b/src/be/nikiroo/fanfix_swing/gui/book/BookPopup.java @@ -47,6 +47,7 @@ public class BookPopup extends JPopupMenu { public void fireElementChanged(BookInfo book); + public void invalidateCache(); } /** @@ -438,7 +439,6 @@ public class BookPopup extends JPopupMenu { lib.changeAuthor(luid, fChangeTo, null); } } - // TODO: ^-- this can create new sources/authors, update maybe required? return null; } @@ -446,11 +446,15 @@ public class BookPopup extends JPopupMenu { @Override protected void done() { try { - // Reload anyway - for (BookInfo book : selected) { - informer.fireElementChanged(book); - } + // this can create new sources/authors, so a simple fireElementChanged is not + // enough, we need to clear the whole cache (for BrowserPanel for instance) + informer.invalidateCache(); + + // TODO: not enough!! + // after move, item disappears in the list, probably caused by the Library + // itself + // Even if problems occurred, still invalidate the cache get(); } catch (Exception e) { UiHelper.error(BookPopup.this.getParent(), e.getLocalizedMessage(), "IOException", e);