On 27 Feb 2009, at 7:28 PM, Stuart Andrews wrote: > > Thanks Adam, > > As I am just connecting to sourceforge, I have not looked at the > code. But once I get that far, I will be asking myself why > we need to cycle through all publications after edited just one?
Because we don't know where the change will have an effect. The updating is queued, and because of that the updating code does not know which item was changed, it only has some general info about what type of changes were made. Also, as Adam said, the smart groups doesn't keep state info, so knowing that a modified pub is contained in a smart group is not relevant info by itself, because we can't know if it was added to the group or already present. > Also, I liked your suggestion for disabling the updating of counts ... > with my BibDesk usage, I would be happy if the smart groups were > computed just once, at startup. Can you recommend a starting point to > tweak this code? > > - Stu The count is recalculated in a method aptly named updateSmartGroupCountAndContent: in the Groups category of BibDocument. Note that this does more than calculating the count, it also updates the shown pubs when this group is selected. Christiaan > On Feb 26, 2009, at 9:28 PM, Maxwell, Adam R wrote: > >> On 02/26/09 16:59, "Stuart Andrews" <[email protected]> wrote: >> >>> So, my question is whether there is a way to make smart groups less >>> diligent in terms of updating their contents after every edit. I >>> would be happy if I could trigger this update myself ... "Ok smart >>> groups, show us your beach-ball magic". >> >> The problem is that the count is updated after each change, so it >> can be >> displayed next to the group name. You could hack the code so smart >> groups >> were updated when selected or something, if you didn't mind an >> incorrect >> count (or disable the count for smart groups). >> >> The best way to fix it would probably be a data model that would >> maintain >> state and relationships in groups (this is greatly complicated by >> things >> like crossrefs and macros). At present, smart groups don't maintain >> any >> state; they're essentially a persistent search. IIRC this works as >> follows: >> >> for (group in smartGroups) { >> for (publication in [document publications]) { >> for (condition in [group conditions]) { >> if ([condition isSatisfiedByPublication:publication]) >> // add to display list >> } >> } >> } >> >> So any change to a publication triggers a linear search through the >> entire >> publications list, evaluating each condition...and that search is >> repeated >> for each group. If it could be changed to iterate the publications >> at the >> outer loop, that would probably help. Threading to evaluate groups >> in >> parallel would be a brute-force win if you have multiple cores, but >> likely >> not be worth the effort. >> >> -- >> adam >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San >> Francisco, CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source >> code: SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Bibdesk-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/bibdesk-users > > Stuart Andrews > [email protected] > > > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source > code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Bibdesk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/bibdesk-users ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Bibdesk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bibdesk-users
