[Chandler-dev] Re: [commits] (stearns) [11110] Fix (or at least, improve) bug 4589 (stamping an event in the detail view is slow with 3000 event calendar), by speeding up the way we look for candidate kinds.

Bryan Stearns stearns at osafoundation.org
Mon Jul 10 14:45:05 PDT 2006


(Oops, forgot: Andi gave me a lot of help behind the scenes for this. 
Thanks, Andi. -Bryan)

commits at osafoundation.org wrote:
>
> Revision
>     11110 <http://viewcvs.osafoundation.org/chandler?view=rev&rev=11110>
> Author
>     stearns
> Date
>     2006-07-10 14:28:12 -0700 (Mon, 10 Jul 2006)
>
>
>       Log Message
>
> Fix (or at least, improve) bug 4589 
> <http://bugzilla.osafoundation.org/show_bug.cgi?id=4589> (stamping an 
> event in the detail view is slow with 3000 event calendar), by 
> speeding up the way we look for candidate kinds.
>
>
>       Modified Paths
>
>     * trunk/chandler/parcels/osaf/pim/items.py
>       <#trunkchandlerparcelsosafpimitemspy>
>
>
>       Diff
>
>
>         Modified: trunk/chandler/parcels/osaf/pim/items.py (11109 =>
>         11110)
>
> --- trunk/chandler/parcels/osaf/pim/items.py	2006-07-10 21:20:27 UTC (rev 11109)
> +++ trunk/chandler/parcels/osaf/pim/items.py	2006-07-10 21:28:12 UTC (rev 11110)
> @@ -368,10 +368,14 @@
>          return the list of candidate kinds for stamping
>          right now, we consider only ContentItems.
>          """
> -        kindKind = self.findPath('//Schema/Core/Kind')
> -        allKinds = kindKind.iterItems()
> -        contentItemKind = ContentItem.getKind (self.itsView)
> -        contentItemKinds = [ aKind for aKind in allKinds if aKind.isKindOf (contentItemKind) ]
> +        contentItemKind = ContentItem.getKind(self.itsView)
> +        contentItemKinds = set((contentItemKind,))
> +        def collectSubKinds(aKind):
> +            subKinds = getattr(aKind, 'subKinds', None)
> +            if subKinds is not None:
> +                contentItemKinds.update(subKinds)
> +                map(collectSubKinds, subKinds)
> +        collectSubKinds(contentItemKind)
>          return contentItemKinds
>  
>      def _computeTargetKindSignature (self, operation, stampKind):
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Commits mailing list
> Commits at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/commits
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/chandler-dev/attachments/20060710/800b53d5/attachment.htm


More information about the chandler-dev mailing list