> > but as I have said, > > params is not enough to make InsetBibtex run smoothly, reconstructing > > EmbeddedFileList each time from param is likely to lead to crashes. > > > > > But your original code DID reconstruct EmbeddedFileList: > LFUN_INSET_MODIFY called createBibFiles(), which deleted the old > structure and built a new one from scratch, and this happened every time > the user edited the inset. You and I agreed a while ago that we > shouldn't reconstruct this each time. Apparently, it worked, but it's a > bit of a waste. So I fixed that and renamed createBibFiles to > updateBibFiles, and now it's not reconstructed each time, but we just > update the ones that need updating. The same code appears in my patch. > That's where I got it.
I was lazy (which may lead to bugs), and the current code is better. The point is that an EmbeddedFile needs to be created once for each file. If you call something like setParam(getParam()) which of course should be discouraged, EmbeddedFileList should not change. > The issue is just whether, > when we need to access the parameters, we should do so by looking at > InsetCommandParams, which is the way most of the code works, or whether > we should look at the EmbeddedFileList. As I have repeated several times, when we look at params, we do not always get what we want because params *does not* hold all the information. For example, when we output to latex, and the file is embedded, we need to use the embedded version and may (I have not figured this part out) need to output /tmp/blah/biblio, instead of biblio. This is why we should ask EmbeddedFile for the parameters. Cheers, Bo