Hey Quentin,
Melodie seems to work with your recent changes. :)
I attached the small CoreObject changes we discussed a few weeks ago.
(Make the API consistent so methods with "objects" in the name can
accept/return objects and groups, and methods with "groups" in the
name only accept/return groups.) As you said, it might be useful to
have "objectsExcludingGroups" methods.
If the changes look okay, I'll commit them!
Eric
On Sun, Aug 24, 2008 at 4:51 AM, Quentin Mathé <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Just a quick mail to let you know that I just returned from my
> vacations and I should now be able to reply to mails.
> I'm just recompiling LLVM right now to check I haven't broken Mélodie
> with my latest CoreObject changes ;-)
>
> Cheers,
> Quentin.
> _______________________________________________
> Etoile-dev mailing list
> [email protected]
> https://mail.gna.org/listinfo/etoile-dev
>
Index: Headers/COGroup.h
===================================================================
--- Headers/COGroup.h (revision 3530)
+++ Headers/COGroup.h (working copy)
@@ -51,8 +51,9 @@
- (NSArray *) groups;
/** Returns all objects belonging to this group, that includes immediate
- children returned by -objects and other descendent children. */
-- (NSArray *) allObjects; /* Not group */
+ children (including subgroups) returned by -objects and other descendent
+ children. */
+- (NSArray *) allObjects;
- (NSArray *) allGroups;
/** Returns YES when the receiver should be handled and displayed as a
COObject
Index: COGroup.m
===================================================================
--- COGroup.m (revision 3530)
+++ COGroup.m (working copy)
@@ -305,6 +305,9 @@
- (BOOL) addObject: (COObject *) object
{
+ if ([object conformsToProtocol: @protocol(COGroup)])
+ return [self addGroup: (id <COGroup>)object];
+
NSMutableArray *a = [self valueForProperty: kCOGroupChildrenProperty];
if ([a containsObject: object] == NO)
{
@@ -328,6 +331,9 @@
- (BOOL) removeObject: (COObject *) object
{
+ if ([object conformsToProtocol: @protocol(COGroup)])
+ return [self removeGroup: (id <COGroup>)object];
+
NSMutableArray *a = [self valueForProperty: kCOGroupChildrenProperty];
if ([a containsObject: object] == YES)
{
@@ -351,7 +357,8 @@
- (NSArray *) objects
{
- return [self valueForProperty: kCOGroupChildrenProperty];
+ return [[self valueForProperty: kCOGroupChildrenProperty]
arrayByAddingObjectsFromArray:
+ [self valueForProperty: kCOGroupSubgroupsProperty]];
}
- (BOOL) addGroup: (id <COGroup>)subgroup
_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev