Title: [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.
(Oops, forgot: Andi gave me a lot of help behind the scenes for this.
Thanks, Andi. -Bryan)
[email protected] wrote:
- Revision
- 11110
- Author
- stearns
- Date
- 2006-07-10 14:28:12 -0700 (Mon, 10 Jul 2006)
Log Message
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.
Modified Paths
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
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Open Source Applications Foundation "chandler-dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/chandler-dev