Title: [commits] (vajda) [11249] - fixed bug 5884
Revision
11249
Author
vajda
Date
2006-07-25 07:31:14 -0700 (Tue, 25 Jul 2006)

Log Message

- fixed bug 5884
(http://bugzilla.osafoundation.org/show_bug.cgi?id=5884)
(Can't overlay the 'all' collection)
- improved collection inspection format

Modified Paths

Diff

Modified: trunk/chandler/parcels/osaf/usercollections.py (11248 => 11249)

--- trunk/chandler/parcels/osaf/usercollections.py	2006-07-24 22:54:46 UTC (rev 11248)
+++ trunk/chandler/parcels/osaf/usercollections.py	2006-07-25 14:31:14 UTC (rev 11249)
@@ -108,7 +108,7 @@
     allUC = UserCollection(pim_ns.allCollection)
     allUC.setValues(renameable=False,
                     outOfTheBoxCollection=True,
-                    allowOverlay = False, # bug 5818
+                    allowOverlay = True,
                     displayNameAlternatives = \
                     {'None': _(u'My items'),
                      'MailMessageMixin': _(u'My mail'),

Modified: trunk/chandler/parcels/osaf/views/main/SideBar.py (11248 => 11249)

--- trunk/chandler/parcels/osaf/views/main/SideBar.py	2006-07-24 22:54:46 UTC (rev 11248)
+++ trunk/chandler/parcels/osaf/views/main/SideBar.py	2006-07-25 14:31:14 UTC (rev 11249)
@@ -1091,8 +1091,21 @@
             if key is None:
                 # we don't have a cached version of this key, so we'll
                 # create a new one
-                if len (collectionList) == 1:
-                    key = collectionList [0]
+
+                # Bug 5884: in order to overlay the allCollection remove
+                # all 'mine' collections already included in collectionList.
+                # Their inclusion in collectionList would be duplicated by
+                # the inclusion of the allCollection and would invalidate
+                # the resulting union.
+                if len(collectionList) > 1:
+                    pim_ns = schema.ns('osaf.pim', self.itsView)
+                    if pim_ns.allCollection in collectionList:
+                        mineCollections = pim_ns.mine.sources
+                        collectionList = [c for c in collectionList
+                                          if c not in mineCollections]
+
+                if len(collectionList) == 1:
+                    key = collectionList[0]
                 else:
                     # eventually it would be nice to just make a
                     # Union here, but we need to make sure each

Modified: trunk/chandler/repository/item/Item.py (11248 => 11249)

--- trunk/chandler/repository/item/Item.py	2006-07-24 22:54:46 UTC (rev 11248)
+++ trunk/chandler/repository/item/Item.py	2006-07-25 14:31:14 UTC (rev 11249)
@@ -2384,15 +2384,15 @@
         indexes = collection._indexes
 
         if indexes is None:
-            indexes = ''
+            return "\n%s%s%s" %('  ' * indent, self._repr_(),
+                                collection._inspect_(indent + 1))
         else:
             indexes = ', '.join((str(t) for t in indexes.iteritems()))
+            return "\n%s%s\n%sindexes: %s%s" %('  ' * indent, self._repr_(),
+                                               '  ' * (indent + 1), indexes,
+                                               collection._inspect_(indent + 1))
 
-        return "\n%s%s\n%sindexes: %s%s" %('  ' * indent, self._repr_(),
-                                           '  ' * (indent + 1), indexes,
-                                           collection._inspect_(indent + 1))
 
-
 class MissingClass(Item):
     pass
 

Modified: trunk/chandler/repository/item/RefCollections.py (11248 => 11249)

--- trunk/chandler/repository/item/RefCollections.py	2006-07-24 22:54:46 UTC (rev 11248)
+++ trunk/chandler/repository/item/RefCollections.py	2006-07-25 14:31:14 UTC (rev 11249)
@@ -727,7 +727,8 @@
         return hash
 
     def _inspect_(self, indent):
-        return ''
+        return "\n%s<RefList> %s<->%s" %('  ' * indent,
+                                         self._name, self._otherName)
 
     def iterItems(self):
         return self.itervalues()




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to