public void fireElementChanged(BookInfo book);
+ public void invalidateCache();
}
/**
private Informer informer;
- private Object object;
-
- private Object object2;
-
- private Object object3;
-
public BookPopup(BasicLibrary lib, Informer informer) {
this.lib = lib;
this.informer = informer;
lib.changeAuthor(luid, fChangeTo, null);
}
}
- // TODO: ^-- this can create new sources/authors, update maybe required?
return null;
}
@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: also refresh the Sources/Authors(/Tags?) list
+ // Even if problems occurred, still invalidate the cache
get();
} catch (Exception e) {
UiHelper.error(BookPopup.this.getParent(), e.getLocalizedMessage(), "IOException", e);
luids.add(book.getMeta().getLuid());
break;
case SOURCE:
- for (MetaData meta : lib.getListBySource(book.getMainInfo())) {
+ for (MetaData meta : lib.getList().filter(book.getMainInfo(), null, null)) {
luids.add(meta.getLuid());
}
break;
case AUTHOR:
- for (MetaData meta : lib.getListByAuthor(book.getMainInfo())) {
+ for (MetaData meta : lib.getList().filter(null, book.getMainInfo(), null)) {
luids.add(meta.getLuid());
}
break;
case TAG:
- for (MetaData meta : lib.getList(null).filter(null, null, book.getMainInfo())) {
+ for (MetaData meta : lib.getList().filter(null, null, book.getMainInfo())) {
luids.add(meta.getLuid());
}
break;